diff options
author | Max Kellermann <max@duempel.org> | 2009-07-19 18:18:32 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-07-19 18:18:32 +0200 |
commit | c9d43b4d713d508b6f5b67cfffba9296f9436934 (patch) | |
tree | 70100c28e365a244f5c6a361d2ecda332df2a756 /src/pcm_convert.c | |
parent | c5ec035fb4a533ebd9f8c69b085604560d2a5487 (diff) | |
parent | 49ede85827c095d0a6ead0ecb63e83e000a76d4f (diff) | |
download | mpd-c9d43b4d713d508b6f5b67cfffba9296f9436934.tar.gz mpd-c9d43b4d713d508b6f5b67cfffba9296f9436934.tar.xz mpd-c9d43b4d713d508b6f5b67cfffba9296f9436934.zip |
Merge branch 'master' of git://git.infradead.org/users/dwmw2/mpd
Conflicts:
Makefile.am
Diffstat (limited to '')
-rw-r--r-- | src/pcm_convert.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/pcm_convert.c b/src/pcm_convert.c index ebb4adff5..2d72628b2 100644 --- a/src/pcm_convert.c +++ b/src/pcm_convert.c @@ -20,6 +20,7 @@ #include "pcm_convert.h" #include "pcm_channels.h" #include "pcm_format.h" +#include "pcm_byteswap.h" #include "audio_format.h" #include <assert.h> @@ -83,6 +84,12 @@ pcm_convert_16(struct pcm_convert_state *state, dest_format->sample_rate, &len); + if (dest_format->reverse_endian) { + buf = pcm_byteswap_16(&state->format_buffer, buf, len); + if (!buf) + g_error("pcm_byteswap_16() failed"); + } + *dest_size_r = len; return buf; } @@ -120,6 +127,12 @@ pcm_convert_24(struct pcm_convert_state *state, dest_format->sample_rate, &len); + if (dest_format->reverse_endian) { + buf = pcm_byteswap_32(&state->format_buffer, buf, len); + if (!buf) + g_error("pcm_byteswap_32() failed"); + } + *dest_size_r = len; return buf; } @@ -157,6 +170,12 @@ pcm_convert_32(struct pcm_convert_state *state, dest_format->sample_rate, &len); + if (dest_format->reverse_endian) { + buf = pcm_byteswap_32(&state->format_buffer, buf, len); + if (!buf) + g_error("pcm_byteswap_32() failed"); + } + *dest_size_r = len; return buf; } |