Tidying up some code.
git-svn-id: https://svn.musicpd.org/mpd/trunk@6527 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:
parent
0bfe6cabce
commit
8feaf84b24
@ -155,32 +155,25 @@ int openAudioOutput(AudioOutput * audioOutput, AudioFormat * audioFormat)
|
|||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
if (audioOutput->open)
|
if (audioOutput->open &&
|
||||||
{
|
0 == cmpAudioFormat(audioFormat, &audioOutput->inAudioFormat)) {
|
||||||
if (0==cmpAudioFormat(audioFormat, &audioOutput->inAudioFormat))
|
|
||||||
{
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
copyAudioFormat(&audioOutput->inAudioFormat, audioFormat);
|
copyAudioFormat(&audioOutput->inAudioFormat, audioFormat);
|
||||||
|
|
||||||
if (audioOutput->convertAudioFormat)
|
if (audioOutput->convertAudioFormat) {
|
||||||
{
|
|
||||||
copyAudioFormat(&audioOutput->outAudioFormat,
|
copyAudioFormat(&audioOutput->outAudioFormat,
|
||||||
&audioOutput->reqAudioFormat);
|
&audioOutput->reqAudioFormat);
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
copyAudioFormat(&audioOutput->outAudioFormat,
|
copyAudioFormat(&audioOutput->outAudioFormat,
|
||||||
&audioOutput->inAudioFormat);
|
&audioOutput->inAudioFormat);
|
||||||
if (audioOutput->open) closeAudioOutput(audioOutput);
|
if (audioOutput->open)
|
||||||
|
closeAudioOutput(audioOutput);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!audioOutput->open)
|
if (!audioOutput->open)
|
||||||
{
|
|
||||||
ret = audioOutput->openDeviceFunc(audioOutput);
|
ret = audioOutput->openDeviceFunc(audioOutput);
|
||||||
}
|
|
||||||
|
|
||||||
audioOutput->sameInAndOutFormats =
|
audioOutput->sameInAndOutFormats =
|
||||||
!cmpAudioFormat(&audioOutput->inAudioFormat,
|
!cmpAudioFormat(&audioOutput->inAudioFormat,
|
||||||
|
Loading…
Reference in New Issue
Block a user