aboutsummaryrefslogtreecommitdiffstats
path: root/src/pcm_convert.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2012-03-21 19:25:52 +0100
committerMax Kellermann <max@duempel.org>2012-03-21 19:31:04 +0100
commit8c5ebdff360021a25b43418d3cd60ea975f5e245 (patch)
tree5780d19719f2493741fd11777bc39baf5361935b /src/pcm_convert.c
parent1c84f324a13bcc3d7fbd84f8d59398b1c801247a (diff)
downloadmpd-8c5ebdff360021a25b43418d3cd60ea975f5e245.tar.gz
mpd-8c5ebdff360021a25b43418d3cd60ea975f5e245.tar.xz
mpd-8c5ebdff360021a25b43418d3cd60ea975f5e245.zip
audio_format: remove the reverse_endian attribute
Eliminate support for reverse endian samples from the MPD core. This moves a lot of complexity to the plugins that really need it (only ALSA and CDIO currently).
Diffstat (limited to 'src/pcm_convert.c')
-rw-r--r--src/pcm_convert.c41
1 files changed, 1 insertions, 40 deletions
diff --git a/src/pcm_convert.c b/src/pcm_convert.c
index 4721d2496..fbdfe5e91 100644
--- a/src/pcm_convert.c
+++ b/src/pcm_convert.c
@@ -21,7 +21,6 @@
#include "pcm_convert.h"
#include "pcm_channels.h"
#include "pcm_format.h"
-#include "pcm_byteswap.h"
#include "pcm_pack.h"
#include "audio_format.h"
#include "glib_compat.h"
@@ -45,7 +44,6 @@ void pcm_convert_init(struct pcm_convert_state *state)
pcm_buffer_init(&state->format_buffer);
pcm_buffer_init(&state->pack_buffer);
pcm_buffer_init(&state->channels_buffer);
- pcm_buffer_init(&state->byteswap_buffer);
}
void pcm_convert_deinit(struct pcm_convert_state *state)
@@ -56,7 +54,6 @@ void pcm_convert_deinit(struct pcm_convert_state *state)
pcm_buffer_deinit(&state->format_buffer);
pcm_buffer_deinit(&state->pack_buffer);
pcm_buffer_deinit(&state->channels_buffer);
- pcm_buffer_deinit(&state->byteswap_buffer);
}
void
@@ -164,11 +161,6 @@ pcm_convert_16(struct pcm_convert_state *state,
return NULL;
}
- if (dest_format->reverse_endian) {
- buf = pcm_byteswap_16(&state->byteswap_buffer, buf, len);
- assert(buf != NULL);
- }
-
*dest_size_r = len;
return buf;
}
@@ -219,11 +211,6 @@ pcm_convert_24(struct pcm_convert_state *state,
return NULL;
}
- if (dest_format->reverse_endian) {
- buf = pcm_byteswap_32(&state->byteswap_buffer, buf, len);
- assert(buf != NULL);
- }
-
*dest_size_r = len;
return buf;
}
@@ -261,8 +248,7 @@ pcm_convert_24_packed(struct pcm_convert_state *state,
size_t dest_size = num_samples * 3;
uint8_t *dest = pcm_buffer_get(&state->pack_buffer, dest_size);
- pcm_pack_24(dest, buffer, buffer + num_samples,
- dest_format->reverse_endian);
+ pcm_pack_24(dest, buffer, buffer + num_samples);
*dest_size_r = dest_size;
return dest;
@@ -314,11 +300,6 @@ pcm_convert_32(struct pcm_convert_state *state,
return buf;
}
- if (dest_format->reverse_endian) {
- buf = pcm_byteswap_32(&state->byteswap_buffer, buf, len);
- assert(buf != NULL);
- }
-
*dest_size_r = len;
return buf;
}
@@ -335,12 +316,6 @@ pcm_convert_float(struct pcm_convert_state *state,
assert(dest_format->format == SAMPLE_FORMAT_FLOAT);
- if (src_format->reverse_endian || dest_format->reverse_endian) {
- g_set_error_literal(error_r, pcm_convert_quark(), 0,
- "Reverse endian not supported");
- return NULL;
- }
-
/* convert channels first, hoping the source format is
supported (float is not) */
@@ -392,20 +367,6 @@ 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;
- }
- }
-
struct audio_format float_format;
if (src_format->format == SAMPLE_FORMAT_DSD) {
size_t f_size;