[FFmpeg-cvslog] ffmpeg: check pts like dts for being in the past.

Michael Niedermayer git at videolan.org
Fri Mar 30 00:23:53 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Thu Mar 29 22:32:53 2012 +0200| [d61ef05bc527a9375de5b70acc7125d2bd1bd473] | committer: Michael Niedermayer

ffmpeg: check pts like dts for being in the past.

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

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

 ffmpeg.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/ffmpeg.c b/ffmpeg.c
index edd87a9..6fcaa5b 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -3129,7 +3129,8 @@ static int transcode(OutputFile *output_files, int nb_output_files,
                     int64_t pkt_pts = av_rescale_q(pkt.pts, ist->st->time_base, AV_TIME_BASE_Q);
                     delta   = pkt_pts - ist->next_dts;
                     if ( delta < -1LL*dts_error_threshold*AV_TIME_BASE ||
-                        (delta > 1LL*dts_error_threshold*AV_TIME_BASE && ist->st->codec->codec_type != AVMEDIA_TYPE_SUBTITLE)) {
+                        (delta > 1LL*dts_error_threshold*AV_TIME_BASE && ist->st->codec->codec_type != AVMEDIA_TYPE_SUBTITLE) ||
+                        pkt_pts+1<ist->pts) {
                         av_log(NULL, AV_LOG_WARNING, "PTS %"PRId64", next:%"PRId64" invalid droping st:%d\n", pkt.pts, ist->next_dts, pkt.stream_index);
                         pkt.pts = AV_NOPTS_VALUE;
                     }



More information about the ffmpeg-cvslog mailing list