aboutsummaryrefslogtreecommitdiffstats
path: root/src/decode.c
diff options
context:
space:
mode:
authorJ. Alexander Treuman <jat@spatialrift.net>2007-08-12 19:23:48 +0000
committerJ. Alexander Treuman <jat@spatialrift.net>2007-08-12 19:23:48 +0000
commit5e1deab05f71f64a881eb708025f16029e011c47 (patch)
treeea5dbdd80b556996ce5bc9f517f5b3ca24353caa /src/decode.c
parentd286294805fc3f05e4d47c7c0c00e4854528186a (diff)
downloadmpd-5e1deab05f71f64a881eb708025f16029e011c47.tar.gz
mpd-5e1deab05f71f64a881eb708025f16029e011c47.tar.xz
mpd-5e1deab05f71f64a881eb708025f16029e011c47.zip
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
Diffstat (limited to '')
-rw-r--r--src/decode.c6
1 files changed, 5 insertions, 1 deletions
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; \