Commit 68a959cb authored by Michael Niedermayer's avatar Michael Niedermayer

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: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 9ed876ac
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment