[FFmpeg-cvslog] lavf: Remove "Adjusting PTS forward" code

Michael Niedermayer git at videolan.org
Fri Dec 21 05:12:39 CET 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Fri Dec 21 04:53:18 2012 +0100| [63753186cc2766e01c6a46d06895a7742c1a768f] | committer: Michael Niedermayer

lavf: Remove "Adjusting PTS forward" code

it causes problems (incorrectly detect TS discontinuities)
 with a brokan TS file (test-audio-broken.ts)

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavformat/utils.c |   14 --------------
 1 file changed, 14 deletions(-)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index 75dc918..a78da36 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -1199,20 +1199,6 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st,
                    pkt->duration                ) {
             int duration = pkt->duration;
 
-            if(st->cur_dts != AV_NOPTS_VALUE && pkt->pts != AV_NOPTS_VALUE && duration){
-                int64_t old_diff= FFABS(st->cur_dts - duration - pkt->pts);
-                int64_t new_diff= FFABS(st->cur_dts - pkt->pts);
-                if(   old_diff < new_diff && old_diff < (duration>>3)
-                   && st->codec->codec_type == AVMEDIA_TYPE_VIDEO
-                   && (!strcmp(s->iformat->name, "mpeg") ||
-                       !strcmp(s->iformat->name, "mpegts"))){
-                    pkt->pts += duration;
-                    av_log(s, AV_LOG_WARNING, "Adjusting PTS forward\n");
-//                    av_log(NULL, AV_LOG_DEBUG, "id:%d old:%"PRId64" new:%"PRId64" dur:%d cur:%s size:%d\n",
-//                           pkt->stream_index, old_diff, new_diff, pkt->duration, av_ts2str(st->cur_dts), pkt->size);
-                }
-            }
-
             /* presentation is not delayed : PTS and DTS are the same */
             if (pkt->pts == AV_NOPTS_VALUE)
                 pkt->pts = pkt->dts;



More information about the ffmpeg-cvslog mailing list