summaryrefslogtreecommitdiffstats
path: root/filters
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2019-05-31 17:51:46 +0200
committerwm4 <wm4@nowhere>2019-09-19 20:37:05 +0200
commitea5c15874a31c3970a2b7a2e2af909a55b945a7f (patch)
treeef43aba93290fa24a88b6129e64ea3ef05505dee /filters
parente86a0df52e6cead69f89064a13fc9eb3358b80a5 (diff)
downloadmpv-ea5c15874a31c3970a2b7a2e2af909a55b945a7f.tar.bz2
mpv-ea5c15874a31c3970a2b7a2e2af909a55b945a7f.tar.xz
f_decoder_wrapper: fully reset timestamp fixup logic on seeks
This could lead to nonsense when backward playback is involved. Better reduce the possible interactions. Besides, it's better to fully reset things on seeks in general. The only exception is has_broken_packet_pts, which enables hr-seek if everything looks good. It's intended to trigger at the second hr-seek or so if the file is normal, and to disable it if the file is broken. It tries to avoid enabling the hr-seek logic before it can know about whether things are "good", so resetting it on seeks would obviously never enable it. Document it as explicit exception.
Diffstat (limited to 'filters')
-rw-r--r--filters/f_decoder_wrapper.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/filters/f_decoder_wrapper.c b/filters/f_decoder_wrapper.c
index f0106bb558..5a0c3f084f 100644
--- a/filters/f_decoder_wrapper.c
+++ b/filters/f_decoder_wrapper.c
@@ -72,6 +72,8 @@ struct priv {
double first_packet_pdts;
// There was at least one packet with nonsense timestamps.
+ // Intentionally not reset on seeks; its whole purpose is to enable faster
+ // future seeks.
int has_broken_packet_pts; // <0: uninitialized, 0: no problems, 1: broken
int has_broken_decoded_pts;
@@ -107,6 +109,8 @@ static void reset_decoder(struct priv *p)
p->pts = MP_NOPTS_VALUE;
p->codec_pts = MP_NOPTS_VALUE;
p->codec_dts = MP_NOPTS_VALUE;
+ p->num_codec_pts_problems = 0;
+ p->num_codec_dts_problems = 0;
p->has_broken_decoded_pts = 0;
p->last_format = p->fixed_format = (struct mp_image_params){0};
p->public.dropped_frames = 0;