From 679e4108f29db061e85687af18f0e013c067f59b Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 28 Feb 2020 17:15:07 +0100 Subject: player: dumb seeking related stuff, make audio hr-seek default Try to deal with various corner cases. But when I fix one thing, another thing breaks. (And it's 50/50 whether I find the breakage immediately or a few months later.) So results may vary. The default for--hr-seek is changed to "default" (not creative enough to find a better name). In this mode, audio seeking is exact if there is no video, or if the video has only a single frame. This change is actually pretty dumb, since audio frames are usually small enough that exact seeking does not really add much. But it gets rid of some weird special cases. Internally, the most important change is that is_coverart and is_sparse handling is merged. is_sparse was originally just a special case for weird .ts streams that have the corresponding low-level flag set. The idea is that they're pretty similar anyway, so this would reduce the number of corner cases. But I'm not sure if this doesn't break the original intended use case for it (I don't have a sample anyway). This changes last-frame handling, and respects the duration of the last frame only if audio is disabled. This is mostly "coincidental" due to the need to make seeking past EOF trigger player exit, and is caused by setting STATUS_EOF early. On the other hand, this might have been this way before (see removed chunk close to it). --- player/audio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'player/audio.c') diff --git a/player/audio.c b/player/audio.c index aae1198835..8aba3d860b 100644 --- a/player/audio.c +++ b/player/audio.c @@ -625,7 +625,8 @@ static bool get_sync_samples(struct MPContext *mpctx, int *skip) !mp_audio_buffer_samples(mpctx->ao_chain->ao_buffer)) return false; // no audio read yet - bool sync_to_video = mpctx->vo_chain && mpctx->video_status != STATUS_EOF; + bool sync_to_video = mpctx->vo_chain && mpctx->video_status != STATUS_EOF && + !mpctx->vo_chain->is_sparse; double sync_pts = MP_NOPTS_VALUE; if (sync_to_video) { -- cgit v1.2.3