aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2011-10-10 09:29:02 +0200
committerMax Kellermann <max@duempel.org>2011-10-10 10:13:43 +0200
commit0129d1e158c4de289adfbb26ae7ea54b26e049ad (patch)
treef08501c5505eb80febd77eee78aefd94e48a2a8d /src
parentece6037a1e654ff01e4238df65490edf68a568a7 (diff)
downloadmpd-0129d1e158c4de289adfbb26ae7ea54b26e049ad.tar.gz
mpd-0129d1e158c4de289adfbb26ae7ea54b26e049ad.tar.xz
mpd-0129d1e158c4de289adfbb26ae7ea54b26e049ad.zip
pcm_convert: support reverse endian input
Diffstat (limited to '')
-rw-r--r--src/pcm_convert.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/pcm_convert.c b/src/pcm_convert.c
index b507999fa..4dbeee41f 100644
--- a/src/pcm_convert.c
+++ b/src/pcm_convert.c
@@ -269,6 +269,20 @@ pcm_convert(struct pcm_convert_state *state,
size_t *dest_size_r,
GError **error_r)
{
+ if (src_format->reverse_endian) {
+ /* convert to host byte order, because all of our
+ conversion libraries assume host byte order */
+
+ src = pcm_byteswap(&state->byteswap_buffer, src_format->format,
+ src, src_size);
+ if (src == NULL) {
+ g_set_error(error_r, pcm_convert_quark(), 0,
+ "PCM byte order change of format '%s' is not implemented",
+ sample_format_to_string(src_format->format));
+ return NULL;
+ }
+ }
+
switch (dest_format->format) {
case SAMPLE_FORMAT_S16:
return pcm_convert_16(state,