aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJ. Alexander Treuman <jat@spatialrift.net>2007-06-09 19:19:33 +0000
committerJ. Alexander Treuman <jat@spatialrift.net>2007-06-09 19:19:33 +0000
commit8feaf84b2439d8e9e321354939a5ec61da0a6ebc (patch)
tree0a270f6a21e797b68d2d7390ca7b14c5b449becf
parent0bfe6cabceb61b4dee2fab1afcd4a80cd39237d2 (diff)
downloadmpd-8feaf84b2439d8e9e321354939a5ec61da0a6ebc.tar.gz
mpd-8feaf84b2439d8e9e321354939a5ec61da0a6ebc.tar.xz
mpd-8feaf84b2439d8e9e321354939a5ec61da0a6ebc.zip
Tidying up some code.
git-svn-id: https://svn.musicpd.org/mpd/trunk@6527 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r--src/audioOutput.c27
1 files changed, 10 insertions, 17 deletions
diff --git a/src/audioOutput.c b/src/audioOutput.c
index 579bdd911..03a5ed782 100644
--- a/src/audioOutput.c
+++ b/src/audioOutput.c
@@ -155,36 +155,29 @@ int openAudioOutput(AudioOutput * audioOutput, AudioFormat * audioFormat)
{
int ret = 0;
- if (audioOutput->open)
- {
- if (0==cmpAudioFormat(audioFormat, &audioOutput->inAudioFormat))
- {
- return 0;
- }
+ if (audioOutput->open &&
+ 0 == cmpAudioFormat(audioFormat, &audioOutput->inAudioFormat)) {
+ return 0;
}
copyAudioFormat(&audioOutput->inAudioFormat, audioFormat);
- if (audioOutput->convertAudioFormat)
- {
+ if (audioOutput->convertAudioFormat) {
copyAudioFormat(&audioOutput->outAudioFormat,
- &audioOutput->reqAudioFormat);
- }
- else
- {
+ &audioOutput->reqAudioFormat);
+ } else {
copyAudioFormat(&audioOutput->outAudioFormat,
- &audioOutput->inAudioFormat);
- if (audioOutput->open) closeAudioOutput(audioOutput);
+ &audioOutput->inAudioFormat);
+ if (audioOutput->open)
+ closeAudioOutput(audioOutput);
}
if (!audioOutput->open)
- {
ret = audioOutput->openDeviceFunc(audioOutput);
- }
audioOutput->sameInAndOutFormats =
!cmpAudioFormat(&audioOutput->inAudioFormat,
- &audioOutput->outAudioFormat);
+ &audioOutput->outAudioFormat);
return ret;
}