use free()/malloc() instead of realloc()
When growing the audioOutput->convBuffer, we can use free()+malloc() instead of realloc(), which saves a memcpy(). git-svn-id: https://svn.musicpd.org/mpd/trunk@7295 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:
committed by
Eric Wong
parent
1d18ca6909
commit
c9d80d6090
@@ -189,8 +189,9 @@ static void convertAudioFormat(AudioOutput * audioOutput,
|
|||||||
&(audioOutput->outAudioFormat));
|
&(audioOutput->outAudioFormat));
|
||||||
|
|
||||||
if (size > audioOutput->convBufferLen) {
|
if (size > audioOutput->convBufferLen) {
|
||||||
audioOutput->convBuffer =
|
if (audioOutput->convBuffer != NULL)
|
||||||
xrealloc(audioOutput->convBuffer, size);
|
free(audioOutput->convBuffer);
|
||||||
|
audioOutput->convBuffer = xmalloc(size);
|
||||||
audioOutput->convBufferLen = size;
|
audioOutput->convBufferLen = size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user