[FFmpeg-soc] [soc]: r4579 - in concat/libavformat: m3u.c playlist.c

gkovacs subversion at mplayerhq.hu
Sat Jul 4 09:25:21 CEST 2009


Author: gkovacs
Date: Sat Jul  4 09:25:21 2009
New Revision: 4579

Log:
now offsetting packet pts to avoid errors with mpeg-ps container

Modified:
   concat/libavformat/m3u.c
   concat/libavformat/playlist.c

Modified: concat/libavformat/m3u.c
==============================================================================
--- concat/libavformat/m3u.c	Sat Jul  4 05:06:04 2009	(r4578)
+++ concat/libavformat/m3u.c	Sat Jul  4 09:25:21 2009	(r4579)
@@ -120,7 +120,9 @@ static int m3u_read_packet(AVFormatConte
     }
     if (ret >= 0) {
         if (pkt) {
-            pkt->dts += ff_conv_stream_time(ic, pkt->stream_index, playld->time_offsets[pkt->stream_index]);
+            int64_t time_offset = ff_conv_stream_time(ic, pkt->stream_index, playld->time_offsets[pkt->stream_index]);
+            pkt->dts += time_offset;
+            pkt->pts += time_offset;
         }
     }
     // TODO switch from AVERROR_EOF to AVERROR_EOS

Modified: concat/libavformat/playlist.c
==============================================================================
--- concat/libavformat/playlist.c	Sat Jul  4 05:06:04 2009	(r4578)
+++ concat/libavformat/playlist.c	Sat Jul  4 09:25:21 2009	(r4579)
@@ -254,10 +254,10 @@ int64_t ff_conv_base_time(AVFormatContex
 {
     int64_t durn;
     durn = (int64_t)(
-           stream_duration *
-           ic->streams[stream_index]->time_base.num *
-           AV_TIME_BASE / // 10^6
-           ic->streams[stream_index]->time_base.den
+           (stream_duration *
+           ic->streams[stream_index]->time_base.num) *
+           (AV_TIME_BASE / // 10^6
+           ic->streams[stream_index]->time_base.den)
            );
     return durn;
 }


More information about the FFmpeg-soc mailing list