On Tue, Sep 09, 2014 at 12:24:21PM -0700, jon wrote: > If the timecode value is negative it certainly seems safe to set the > AV_TIMECODE_FLAG_ALLOWNEGATIVE on the AVTimecode object.
> From 35ae38f9557e1ff01040d0e681e843d1727f979b Mon Sep 17 00:00:00 2001 > From: Jon Morley <j...@tweaksoftware.com> > Date: Tue, 9 Sep 2014 12:12:17 -0700 > Subject: [PATCH 2/2] libavutil/timecode.c: improve flag setting when init tc > from string > > If the string begins with a negative HH (hour) value then make sure to > set the AV_TIMECODE_FLAG_ALLOW_NEGATIVE flag for the resulting > tc->flags. > --- > libavutil/timecode.c | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > > diff --git a/libavutil/timecode.c b/libavutil/timecode.c > index 1dfd040..b96a4d1 100644 > --- a/libavutil/timecode.c > +++ b/libavutil/timecode.c > @@ -201,9 +201,10 @@ int av_timecode_init_from_string(AVTimecode *tc, > AVRational rate, const char *st > } > > memset(tc, 0, sizeof(*tc)); > - tc->flags = c != ':' ? AV_TIMECODE_FLAG_DROPFRAME : 0; // drop if ';', > '.', ... > - tc->rate = rate; > - tc->fps = fps_from_frame_rate(rate); > + tc->flags = c != ':' ? AV_TIMECODE_FLAG_DROPFRAME : 0; // drop if ';', > '.', ... > + tc->flags |= (hh < 0) ? AV_TIMECODE_FLAG_ALLOWNEGATIVE : 0; // neg if > starts with '-' > + tc->rate = rate; > + tc->fps = fps_from_frame_rate(rate); > > ret = check_timecode(log_ctx, tc); > if (ret < 0) What does this fix exactly? [...] -- Clément B.
pgpnEerEZIfD5.pgp
Description: PGP signature
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel