From 3fe6b36eb095698ef8f7de9d082dd55d6f575667 Mon Sep 17 00:00:00 2001 From: Marko Hauptvogel Date: Sun, 16 Apr 2017 11:02:30 +0200 Subject: player: close audio device on no audio track Close the audio device if there is no audio track (or stream) in the current file. It will be opened again if the next file should contain audio. Signed-off-by: Marko Hauptvogel Signed-off-by: wm4 --- player/audio.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'player') diff --git a/player/audio.c b/player/audio.c index d05cae83cd..b2e44c23dd 100644 --- a/player/audio.c +++ b/player/audio.c @@ -511,8 +511,10 @@ void reinit_audio_chain_src(struct MPContext *mpctx, struct lavfi_pad *src) struct sh_stream *sh = NULL; if (!src) { track = mpctx->current_track[0][STREAM_AUDIO]; - if (!track) + if (!track) { + uninit_audio_out(mpctx); return; + } sh = track->stream; if (!sh) { uninit_audio_out(mpctx); -- cgit v1.2.3