From 7f7340ce7627135a5f858ae538fd9a9f140b1ed1 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 28 Jan 2015 19:36:46 +0100 Subject: player: enable hr-seek on audio after video end Some files can have audio after video has ended, and playback of the audio-only remainder is supposed to work just fine. Seeking is broken-ish though. Not much can be done about this, since it's the way demuxers work. Also, such files are obscure corner cases. But enabling hr-seek for audio after video end can improve the situation a lot. This helps with issue #1533. The reported also provided a command line to produce such a file: ffmpeg -i image.jpg -i audio.flac -threads $(nproc) \ -c:v libvpx -crf 10 -qmin 5 -qmax 55 \ -vf scale=360:-1 -sws_flags lanczos -c:a libvorbis -ac 2 \ -b:a 128K out.webm --- player/audio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/player/audio.c b/player/audio.c index c49f2ea523..d6fb348f58 100644 --- a/player/audio.c +++ b/player/audio.c @@ -401,7 +401,8 @@ static bool get_sync_samples(struct MPContext *mpctx, int *skip) if (written_pts == MP_NOPTS_VALUE && !mp_audio_buffer_samples(mpctx->ao_buffer)) return false; // no audio read yet - bool sync_to_video = mpctx->d_video && mpctx->sync_audio_to_video; + bool sync_to_video = mpctx->d_video && mpctx->sync_audio_to_video && + mpctx->video_status != STATUS_EOF; double sync_pts = MP_NOPTS_VALUE; if (sync_to_video) { -- cgit v1.2.3