mpegts: force the default timebase
authorRudolf Polzer <divVerent@xonotic.org>
Thu, 14 Apr 2011 09:12:57 +0000 (11:12 +0200)
committerLuca Barbato <lu_zero@gentoo.org>
Thu, 14 Apr 2011 11:51:26 +0000 (13:51 +0200)
The mpegts muxer does not set the stream time base using
av_set_pts_info, but expects it to have the default value of 1/90000.
If the calling code changes stream pts before writing the header,
other muxers override the time base at that point (like mpegenc.c).

libavformat/mpegtsenc.c

index 40b906e..35db93b 100644 (file)
@@ -479,6 +479,7 @@ static int mpegts_write_header(AVFormatContext *s)
     /* assign pids to each stream */
     for(i = 0;i < s->nb_streams; i++) {
         st = s->streams[i];
+        av_set_pts_info(st, 33, 1, 90000);
         ts_st = av_mallocz(sizeof(MpegTSWriteStream));
         if (!ts_st)
             goto fail;