summaryrefslogtreecommitdiffstats
path: root/player
diff options
context:
space:
mode:
authorMarko Hauptvogel <marko.hauptvogel@googlemail.com>2017-04-16 11:02:30 +0200
committerwm4 <wm4@nowhere>2017-04-25 20:21:09 +0200
commit3fe6b36eb095698ef8f7de9d082dd55d6f575667 (patch)
tree748639c48958552294ce30aa82adbf4486300f7f /player
parent18703b55d8db35cf8db2f4342f1b5880014d0a28 (diff)
downloadmpv-3fe6b36eb095698ef8f7de9d082dd55d6f575667.tar.bz2
mpv-3fe6b36eb095698ef8f7de9d082dd55d6f575667.tar.xz
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 <marko.hauptvogel@googlemail.com> Signed-off-by: wm4 <wm4@nowhere>
Diffstat (limited to 'player')
-rw-r--r--player/audio.c4
1 files changed, 3 insertions, 1 deletions
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);