From ca1bae3983c6592efe4635e7e35a1f85833674b8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Cl=C3=A9ment=20B=C5=93sch?= Date: Wed, 4 Jan 2012 17:30:03 +0100 Subject: [PATCH] timecode: support >24h timecode. --- libavcodec/timecode.c | 2 +- libavcodec/timecode.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/libavcodec/timecode.c b/libavcodec/timecode.c index 8e2e599c21d..2e0f4a489b8 100644 --- a/libavcodec/timecode.c +++ b/libavcodec/timecode.c @@ -94,7 +94,7 @@ 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); snprintf(buf, 16, "%s%02d:%02d:%02d%c%02d", neg ? "-" : "", hh, mm, ss, tc->drop ? ';' : ':', ff); diff --git a/libavcodec/timecode.h b/libavcodec/timecode.h index 076f04763f9..ee03fdab7f7 100644 --- a/libavcodec/timecode.h +++ b/libavcodec/timecode.h @@ -67,7 +67,8 @@ uint32_t avpriv_framenum_to_smpte_timecode(unsigned frame, int fps, int drop); * @param tc Timecode struct pointer * @param frame Frame id (timecode frame is computed with tc->start+frame) * @return a pointer to the buf parameter - * @note timecode representation can be a negative timecode + * @note timecode representation can be a negative timecode and have + * more than 24 hours. * @note buf must have enough space to store the timecode representation: 16 * bytes is the minimum required size. */ -- 2.39.2