diff options
author | J. Alexander Treuman <jat@spatialrift.net> | 2007-05-24 21:15:37 +0000 |
---|---|---|
committer | J. Alexander Treuman <jat@spatialrift.net> | 2007-05-24 21:15:37 +0000 |
commit | 2814b7cfc650a73146b8e18fd0a55d54c3ec613d (patch) | |
tree | b632095b1b73c8c310e6cdd8c92ca52807061740 /src/audioOutput.c | |
parent | 7ba357a04e75c51f898e9418cab24d10c74ab37c (diff) | |
download | mpd-2814b7cfc650a73146b8e18fd0a55d54c3ec613d.tar.gz mpd-2814b7cfc650a73146b8e18fd0a55d54c3ec613d.tar.xz mpd-2814b7cfc650a73146b8e18fd0a55d54c3ec613d.zip |
Reverting to the full lsr API. Turns out the simple API needs all of the
audio at once, so it won't work for us. The old full API code was still
heavily broken, as each call to pcm_convertSampleRate() used the same
state, even if it was processing two streams of audio. The new code keeps
a separate state for each audio stream that's being converted.
git-svn-id: https://svn.musicpd.org/mpd/trunk@6255 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/audioOutput.c')
-rw-r--r-- | src/audioOutput.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/audioOutput.c b/src/audioOutput.c index 7a99dfd68..ccc701451 100644 --- a/src/audioOutput.c +++ b/src/audioOutput.c @@ -135,6 +135,7 @@ int initAudioOutput(AudioOutput *ao, ConfigParam * param) memset(&ao->inAudioFormat, 0, sizeof(AudioFormat)); memset(&ao->outAudioFormat, 0, sizeof(AudioFormat)); memset(&ao->reqAudioFormat, 0, sizeof(AudioFormat)); + memset(&ao->convState, 0, sizeof(ConvState)); if (format) { ao->convertAudioFormat = 1; @@ -205,10 +206,11 @@ static void convertAudioFormat(AudioOutput * audioOutput, char **chunkArgPtr, } pcm_convertAudioFormat(&(audioOutput->inAudioFormat), - *chunkArgPtr, - *sizeArgPtr, - &(audioOutput->outAudioFormat), - audioOutput->convBuffer); + *chunkArgPtr, + *sizeArgPtr, + &(audioOutput->outAudioFormat), + audioOutput->convBuffer, + &audioOutput->convState); *sizeArgPtr = size; *chunkArgPtr = audioOutput->convBuffer; |