summaryrefslogtreecommitdiffstats
path: root/player/audio.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2020-02-28 17:15:07 +0100
committerwm4 <wm4@nowhere>2020-02-28 17:15:07 +0100
commit679e4108f29db061e85687af18f0e013c067f59b (patch)
treec5ade054525ba1e7832f5997ebf7f4d234bc81e2 /player/audio.c
parent85576f31a9cc25ca75ac7d265aaaf211f76a4842 (diff)
downloadmpv-679e4108f29db061e85687af18f0e013c067f59b.tar.bz2
mpv-679e4108f29db061e85687af18f0e013c067f59b.tar.xz
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).
Diffstat (limited to 'player/audio.c')
-rw-r--r--player/audio.c3
1 files changed, 2 insertions, 1 deletions
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) {