From 6cbd7d63902c88dc504d98f517b455d2f560f975 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 4 Feb 2016 15:28:25 +0100 Subject: [PATCH] video: remove AVI timestamps for dropped frames Might possible improve A/V sync, although this is at best approximate. (AVI is just fucked.) --- video/decode/dec_video.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/video/decode/dec_video.c b/video/decode/dec_video.c index b278cdfe82..ed0bfb825e 100644 --- a/video/decode/dec_video.c +++ b/video/decode/dec_video.c @@ -294,9 +294,13 @@ static struct mp_image *decode_packet(struct dec_video *d_video, MP_STATS(d_video, "end decode video"); + // Error, discarded frame, dropped frame, or initial codec delay. if (!mpi || drop_frame) { + // If we already had output, this must be a dropped frame. + if (d_video->decoded_pts != MP_NOPTS_VALUE && d_video->num_buffered_pts) + d_video->num_buffered_pts--; talloc_free(mpi); - return NULL; // error / skipped frame + return NULL; } if (opts->field_dominance == 0) {