[FFmpeg-cvslog] timecode: support >24h timecode.
Clément Bœsch
git at videolan.org
Wed Jan 11 18:18:27 CET 2012
ffmpeg | branch: master | Clément Bœsch <clement.boesch at smartjog.com> | Wed Jan 4 17:30:03 2012 +0100| [ca1bae3983c6592efe4635e7e35a1f85833674b8] | committer: Clément Bœsch
timecode: support >24h timecode.
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ca1bae3983c6592efe4635e7e35a1f85833674b8
---
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 8e2e599..2e0f4a4 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 076f047..ee03fda 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.
*/
More information about the ffmpeg-cvslog
mailing list