diff options
authorwm4 <wm4@nowhere>2019-09-26 19:52:10 +0200
committerwm4 <wm4@nowhere>2019-09-26 19:52:10 +0200
commitc1956e82c2da01aba64251b885a3e8d5ab7179d3 (patch)
parentf44e480242057ecc7a84588a65dfef62264a5534 (diff)
audio: make playback end with --end and --audio-spdif
In spdif mode, there are hacks that try to cut audio on frame boundaries (blame spdif, which is a hack in itself). The "alignment" is used in a bunch of places, but --end does not respect it. This leads to some audio that can't be pushed because the alignment is off (I don't know why, not do I care), which puts audio into an underrun state forever. Fix this by discarding unusable extra samples if no new data can be expected. Fixes: #6935
1 files changed, 3 insertions, 0 deletions
diff --git a/player/audio.c b/player/audio.c
index 22a87c91eb..308b27aec1 100644
--- a/player/audio.c
+++ b/player/audio.c
@@ -975,6 +975,9 @@ void fill_audio_out_buffers(struct MPContext *mpctx)
audio_eof &= partial_fill;
+ if (audio_eof && playsize < align)
+ playsize = 0;
// With gapless audio, delay this to ao_uninit. There must be only
// 1 final chunk, and that is handled when calling ao_uninit().
if (audio_eof && !opts->gapless_audio)