[FFmpeg-cvslog] mov: use new public timecode API.

Clément Bœsch git at videolan.org
Thu Feb 2 14:41:10 CET 2012


ffmpeg | branch: master | Clément Bœsch <clement.boesch at smartjog.com> | Mon Jan 23 15:10:43 2012 +0100| [bd10f01aa8baa6af79695b0c311a01ef900f87a7] | committer: Clément Bœsch

mov: use new public timecode API.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=bd10f01aa8baa6af79695b0c311a01ef900f87a7
---

 libavformat/mov.c |   21 ++++++++++-----------
 1 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 851997c..6755152 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -31,13 +31,13 @@
 #include "libavutil/avstring.h"
 #include "libavutil/dict.h"
 #include "libavutil/opt.h"
+#include "libavutil/timecode.h"
 #include "avformat.h"
 #include "internal.h"
 #include "avio_internal.h"
 #include "riff.h"
 #include "isom.h"
 #include "libavcodec/get_bits.h"
-#include "libavcodec/timecode.h"
 #include "id3v1.h"
 #include "mov_chan.h"
 
@@ -2656,17 +2656,16 @@ finish:
 static int parse_timecode_in_framenum_format(AVFormatContext *s, AVStream *st,
                                              uint32_t value)
 {
-    char buf[16];
-    struct ff_timecode tc = {
-        .drop  = st->codec->flags2 & CODEC_FLAG2_DROP_FRAME_TIMECODE,
-        .rate  = (AVRational){st->codec->time_base.den,
-                              st->codec->time_base.num},
-    };
-
-    if (avpriv_check_timecode_rate(s, tc.rate, tc.drop) < 0)
-        return AVERROR(EINVAL);
+    AVTimecode tc;
+    char buf[AV_TIMECODE_STR_SIZE];
+    AVRational rate = {st->codec->time_base.den,
+                       st->codec->time_base.num};
+    int flags = st->codec->flags2 & CODEC_FLAG2_DROP_FRAME_TIMECODE ? AV_TIMECODE_FLAG_DROPFRAME : 0;
+    int ret = av_timecode_init(&tc, rate, flags, 0, s);
+    if (ret < 0)
+        return ret;
     av_dict_set(&st->metadata, "timecode",
-                avpriv_timecode_to_string(buf, &tc, value), 0);
+                av_timecode_make_string(&tc, buf, value), 0);
     return 0;
 }
 



More information about the ffmpeg-cvslog mailing list