diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-02-14 20:27:07 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-02-14 20:42:13 +0100 |
commit | 68a959cb271767d65a7f0e382e518d8270588308 (patch) | |
tree | 63b0229b763fb9695f05973b892191e78498756d | |
parent | 9ed876ac92b92571a7986efa35421194588ac187 (diff) | |
download | ffmpeg-68a959cb271767d65a7f0e382e518d8270588308.tar.gz |
avcodec/utils: improve guess_correct_pts() by considerng mixed dts/pts use caused by NOPTSs
No testcase known, this is a theoretical improvment
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/utils.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 135fd831e5..ea7765493a 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -1966,11 +1966,15 @@ static int64_t guess_correct_pts(AVCodecContext *ctx, if (dts != AV_NOPTS_VALUE) { ctx->pts_correction_num_faulty_dts += dts <= ctx->pts_correction_last_dts; ctx->pts_correction_last_dts = dts; - } + } else if (reordered_pts != AV_NOPTS_VALUE) + ctx->pts_correction_last_dts = reordered_pts; + if (reordered_pts != AV_NOPTS_VALUE) { ctx->pts_correction_num_faulty_pts += reordered_pts <= ctx->pts_correction_last_pts; ctx->pts_correction_last_pts = reordered_pts; - } + } else if(dts != AV_NOPTS_VALUE) + ctx->pts_correction_last_pts = dts; + if ((ctx->pts_correction_num_faulty_pts<=ctx->pts_correction_num_faulty_dts || dts == AV_NOPTS_VALUE) && reordered_pts != AV_NOPTS_VALUE) pts = reordered_pts; |