From 5e1deab05f71f64a881eb708025f16029e011c47 Mon Sep 17 00:00:00 2001 From: "J. Alexander Treuman" Date: Sun, 12 Aug 2007 19:23:48 +0000 Subject: decode: close audio device after initial open if paused Currently, if we start decoding while the pause flag is set, we open the audio device and leave it opened, blocking other apps from using it. The obvious thing to do is to not open the audio device if the pause flag is set, but the open call also sets the audio format. Therefore I'm leaving the open call in, and just closing it immediately afterwards if the pause flag is set. git-svn-id: https://svn.musicpd.org/mpd/trunk@6745 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- src/decode.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/decode.c') diff --git a/src/decode.c b/src/decode.c index 3f9c8610d..fcda78a19 100644 --- a/src/decode.c +++ b/src/decode.c @@ -124,7 +124,11 @@ static int calculateCrossFadeChunks(PlayerControl * pc, AudioFormat * af) ERROR("problems opening audio device while playing \"%s\"\n", pc->utf8url); \ quitDecode(pc,dc); \ return; \ - } \ + } \ + if (pause) { \ + dropBufferedAudio(); \ + closeAudioDevice(); \ + } \ pc->totalTime = dc->totalTime; \ pc->sampleRate = dc->audioFormat.sampleRate; \ pc->bits = dc->audioFormat.bits; \ -- cgit v1.2.3