[FFmpeg-devel] [PATCH 3/4] timecode: support >24h timecode.
Clément Bœsch
ubitux at gmail.com
Wed Jan 11 18:21:27 CET 2012
On Tue, Jan 10, 2012 at 05:35:11PM -0800, Baptiste Coudurier wrote:
> On 01/05/2012 12:03 PM, Clément Bœsch wrote:
> > From: Clément Bœsch <clement.boesch at smartjog.com>
> >
> > ---
> > libavcodec/timecode.c | 4 ++--
> > libavcodec/timecode.h | 5 +++--
> > libavcodec/version.h | 2 +-
> > 3 files changed, 6 insertions(+), 5 deletions(-)
> >
> > diff --git a/libavcodec/timecode.c b/libavcodec/timecode.c
> > index a8b4242..31bf219 100644
> > --- a/libavcodec/timecode.c
> > +++ b/libavcodec/timecode.c
> > @@ -90,10 +90,10 @@ char *avpriv_timecode_to_string(char *buf, const struct ff_timecode *tc, unsigne
> > ff = frame_num % fps;
> > ss = frame_num / fps % 60;
> > mm = frame_num / (fps*60) % 60;
> > - hh = frame_num / (fps*3600) % 24;
> > + hh = frame_num / (fps*3600);
> > if (ff < 0 || ss < 0 || mm < 0 || hh < 0)
> > neg = 1, ff = -ff, ss = -ss, mm = -mm, hh = -hh;
> > - snprintf(buf, sizeof("-hh:mm:ss.ff"), "%s%02d:%02d:%02d%c%02d",
> > + snprintf(buf, sizeof("-hhh:mm:ss.ff"), "%s%02d:%02d:%02d%c%02d",
> > neg ? "-" : "",
> > hh, mm, ss, tc->drop ? ';' : ':', ff);
>
> Humm this requires a fixed size buffer and it should be documented in the API,
> 16 or 32 seems fair.
> I think it's better to replace the template string by the documented fixed size
> required.
>
OK, I added a commit at the root of the patchset to change this (16B).
> Except that it's fine.
>
Patch pushed.
[...]
--
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120111/01d54b4a/attachment.asc>
More information about the ffmpeg-devel
mailing list