[FFmpeg-soc] [soc]: r2995 - mxf/mxfenc.c

spyfeng subversion at mplayerhq.hu
Sat Aug 2 15:56:05 CEST 2008


Author: spyfeng
Date: Sat Aug  2 15:56:05 2008
New Revision: 2995

Log:
move the code from mxf_write_track() to streams initial loop in mxf_write_header_metadata_sets().


Modified:
   mxf/mxfenc.c

Modified: mxf/mxfenc.c
==============================================================================
--- mxf/mxfenc.c	(original)
+++ mxf/mxfenc.c	Sat Aug  2 15:56:05 2008
@@ -596,13 +596,6 @@ static int mxf_write_track(AVFormatConte
     st = s->streams[stream_index];
     sc = st->priv_data;
 
-    // set pts information
-    if (st->codec->codec_type == CODEC_TYPE_VIDEO) {
-        av_set_pts_info(st, 64, 1, st->codec->time_base.den);
-    } else if (st->codec->codec_type == CODEC_TYPE_AUDIO) {
-        av_set_pts_info(st, 64, 1, st->codec->sample_rate);
-    }
-
     // write track uid
     mxf_write_local_tag(pb, 16, 0x3C0A);
     put_buffer(pb, (*refs->track)[stream_index], 16);
@@ -945,6 +938,12 @@ static int mxf_write_header_metadata_set
         if (!sc)
             return AVERROR(ENOMEM);
         st->priv_data = sc;
+        // set pts information
+        if (st->codec->codec_type == CODEC_TYPE_VIDEO) {
+            av_set_pts_info(st, 64, 1, st->codec->time_base.den);
+        } else if (st->codec->codec_type == CODEC_TYPE_AUDIO) {
+            av_set_pts_info(st, 64, 1, st->codec->sample_rate);
+        }
     }
 
     if (mxf_build_structural_metadata(s, &klv, MaterialPackage) < 0)



More information about the FFmpeg-soc mailing list