audio_format: remove the format SAMPLE_FORMAT_DSD_LSBFIRST

This format is unused since the DSDIFF decoder plugin now reverses the
bit order.
This commit is contained in:
Max Kellermann 2012-03-21 09:06:48 +01:00
parent 238c3adad1
commit 9c6a4505c8
11 changed files with 4 additions and 36 deletions

View File

@ -75,9 +75,6 @@ sample_format_to_string(enum sample_format format)
case SAMPLE_FORMAT_DSD:
return "dsd";
case SAMPLE_FORMAT_DSD_LSBFIRST:
return "dsdl";
case SAMPLE_FORMAT_DSD_OVER_USB:
return "dsdusb";
}

View File

@ -56,12 +56,6 @@ enum sample_format {
*/
SAMPLE_FORMAT_DSD,
/**
* Same as #SAMPLE_FORMAT_DSD, but the least significant bit
* comes first.
*/
SAMPLE_FORMAT_DSD_LSBFIRST,
/**
* DSD packed in 24 bit samples (no padding), according to the
* dCS suggested standard:
@ -195,7 +189,6 @@ audio_valid_sample_format(enum sample_format format)
case SAMPLE_FORMAT_S32:
case SAMPLE_FORMAT_FLOAT:
case SAMPLE_FORMAT_DSD:
case SAMPLE_FORMAT_DSD_LSBFIRST:
case SAMPLE_FORMAT_DSD_OVER_USB:
return true;
@ -275,7 +268,6 @@ sample_format_size(enum sample_format format)
return 4;
case SAMPLE_FORMAT_DSD:
case SAMPLE_FORMAT_DSD_LSBFIRST:
/* each frame has 8 samples per channel */
return 1;

View File

@ -94,14 +94,8 @@ parse_sample_format(const char *src, bool mask,
}
if (memcmp(src, "dsd", 3) == 0) {
if (src[3] == 'l') {
*sample_format_r = SAMPLE_FORMAT_DSD_LSBFIRST;
*endptr_r = src + 4;
} else {
*sample_format_r = SAMPLE_FORMAT_DSD;
*endptr_r = src + 3;
}
*sample_format_r = SAMPLE_FORMAT_DSD;
*endptr_r = src + 3;
return true;
}

View File

@ -104,7 +104,6 @@ flac_convert(void *dest,
case SAMPLE_FORMAT_S24:
case SAMPLE_FORMAT_FLOAT:
case SAMPLE_FORMAT_DSD:
case SAMPLE_FORMAT_DSD_LSBFIRST:
case SAMPLE_FORMAT_DSD_OVER_USB:
case SAMPLE_FORMAT_UNDEFINED:
/* unreachable */

View File

@ -195,7 +195,6 @@ get_bitformat(enum sample_format sample_format)
switch (sample_format) {
case SAMPLE_FORMAT_UNDEFINED:
case SAMPLE_FORMAT_DSD:
case SAMPLE_FORMAT_DSD_LSBFIRST:
case SAMPLE_FORMAT_DSD_OVER_USB:
return SND_PCM_FORMAT_UNKNOWN;

View File

@ -397,7 +397,6 @@ sample_format_to_oss(enum sample_format format)
case SAMPLE_FORMAT_UNDEFINED:
case SAMPLE_FORMAT_FLOAT:
case SAMPLE_FORMAT_DSD:
case SAMPLE_FORMAT_DSD_LSBFIRST:
case SAMPLE_FORMAT_DSD_OVER_USB:
return AFMT_QUERY;

View File

@ -76,7 +76,6 @@ pcm_byteswap(struct pcm_buffer *buffer, enum sample_format format,
case SAMPLE_FORMAT_S8:
case SAMPLE_FORMAT_DSD:
case SAMPLE_FORMAT_DSD_LSBFIRST:
return src;
case SAMPLE_FORMAT_S16:

View File

@ -81,7 +81,6 @@ pcm_convert_channels(struct pcm_buffer *buffer, enum sample_format format,
case SAMPLE_FORMAT_S24:
case SAMPLE_FORMAT_FLOAT:
case SAMPLE_FORMAT_DSD:
case SAMPLE_FORMAT_DSD_LSBFIRST:
case SAMPLE_FORMAT_DSD_OVER_USB:
g_set_error(error_r, pcm_convert_quark(), 0,
"Channel conversion not implemented for format '%s'",
@ -408,14 +407,11 @@ pcm_convert(struct pcm_convert_state *state,
}
struct audio_format float_format;
if (src_format->format == SAMPLE_FORMAT_DSD ||
src_format->format == SAMPLE_FORMAT_DSD_LSBFIRST) {
if (src_format->format == SAMPLE_FORMAT_DSD) {
size_t f_size;
const bool lsbfirst =
src_format->format == SAMPLE_FORMAT_DSD_LSBFIRST;
const float *f = pcm_dsd_to_float(&state->dsd,
src_format->channels,
lsbfirst, src, src_size,
false, src, src_size,
&f_size);
if (f == NULL) {
g_set_error_literal(error_r, pcm_convert_quark(), 0,

View File

@ -148,7 +148,6 @@ pcm_convert_to_16(struct pcm_buffer *buffer, struct pcm_dither *dither,
switch (src_format) {
case SAMPLE_FORMAT_UNDEFINED:
case SAMPLE_FORMAT_DSD:
case SAMPLE_FORMAT_DSD_LSBFIRST:
case SAMPLE_FORMAT_DSD_OVER_USB:
break;
@ -269,7 +268,6 @@ pcm_convert_to_24(struct pcm_buffer *buffer,
switch (src_format) {
case SAMPLE_FORMAT_UNDEFINED:
case SAMPLE_FORMAT_DSD:
case SAMPLE_FORMAT_DSD_LSBFIRST:
case SAMPLE_FORMAT_DSD_OVER_USB:
break;
@ -396,7 +394,6 @@ pcm_convert_to_32(struct pcm_buffer *buffer,
switch (src_format) {
case SAMPLE_FORMAT_UNDEFINED:
case SAMPLE_FORMAT_DSD:
case SAMPLE_FORMAT_DSD_LSBFIRST:
case SAMPLE_FORMAT_DSD_OVER_USB:
break;
@ -534,7 +531,6 @@ pcm_convert_to_float(struct pcm_buffer *buffer,
switch (src_format) {
case SAMPLE_FORMAT_UNDEFINED:
case SAMPLE_FORMAT_DSD:
case SAMPLE_FORMAT_DSD_LSBFIRST:
case SAMPLE_FORMAT_DSD_OVER_USB:
break;

View File

@ -121,7 +121,6 @@ pcm_add_vol(void *buffer1, const void *buffer2, size_t size,
case SAMPLE_FORMAT_UNDEFINED:
case SAMPLE_FORMAT_S24:
case SAMPLE_FORMAT_DSD:
case SAMPLE_FORMAT_DSD_LSBFIRST:
case SAMPLE_FORMAT_DSD_OVER_USB:
/* not implemented */
return false;
@ -233,7 +232,6 @@ pcm_add(void *buffer1, const void *buffer2, size_t size,
case SAMPLE_FORMAT_UNDEFINED:
case SAMPLE_FORMAT_S24:
case SAMPLE_FORMAT_DSD:
case SAMPLE_FORMAT_DSD_LSBFIRST:
case SAMPLE_FORMAT_DSD_OVER_USB:
/* not implemented */
return false;

View File

@ -160,7 +160,6 @@ pcm_volume(void *buffer, size_t length,
case SAMPLE_FORMAT_UNDEFINED:
case SAMPLE_FORMAT_S24:
case SAMPLE_FORMAT_DSD:
case SAMPLE_FORMAT_DSD_LSBFIRST:
case SAMPLE_FORMAT_DSD_OVER_USB:
/* not implemented */
return false;