decoder/wavpack: activate 32 bit support
MPD has been supporting 32 bit samples since version 0.15. This patch changes one check, and removes the 32->24 conversion code. Note that WavPack floating point samples have 32 bits, and MPD doesn't have a special check for floating point - therefore, this WavPack plugin still returns 24 bit integer samples as before (until we have float support in the MPD core).
This commit is contained in:
parent
4c6a8e3ca5
commit
ee5d3337a7
1
NEWS
1
NEWS
|
@ -24,6 +24,7 @@ ver 0.16 (20??/??/??)
|
||||||
- sidplay: support sub-tunes
|
- sidplay: support sub-tunes
|
||||||
- sidplay: implemented songlength database
|
- sidplay: implemented songlength database
|
||||||
- sidplay: support seeking
|
- sidplay: support seeking
|
||||||
|
- wavpack: activate 32 bit support
|
||||||
* encoders:
|
* encoders:
|
||||||
- twolame: new encoder plugin based on libtwolame
|
- twolame: new encoder plugin based on libtwolame
|
||||||
* output:
|
* output:
|
||||||
|
|
|
@ -97,19 +97,11 @@ format_samples_int(int bytes_per_sample, void *buffer, uint32_t count)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case 3:
|
case 3:
|
||||||
|
case 4:
|
||||||
/* do nothing */
|
/* do nothing */
|
||||||
break;
|
break;
|
||||||
case 4: {
|
|
||||||
uint32_t *dst = buffer;
|
|
||||||
assert_static(sizeof(*dst) <= sizeof(*src));
|
|
||||||
|
|
||||||
/* downsample to 24-bit */
|
|
||||||
while (count--) {
|
|
||||||
*dst++ = *src++ >> 8;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -151,10 +143,12 @@ wavpack_decode(struct decoder *decoder, WavpackContext *wpc, bool can_seek,
|
||||||
|
|
||||||
/* round bitwidth to 8-bit units */
|
/* round bitwidth to 8-bit units */
|
||||||
audio_format.bits = (audio_format.bits + 7) & (~7);
|
audio_format.bits = (audio_format.bits + 7) & (~7);
|
||||||
/* mpd handles max 24-bit samples */
|
/* MPD handles max 32-bit samples */
|
||||||
if (audio_format.bits > 24) {
|
if (audio_format.bits > 32)
|
||||||
|
audio_format.bits = 32;
|
||||||
|
|
||||||
|
if ((WavpackGetMode(wpc) & MODE_FLOAT) == MODE_FLOAT)
|
||||||
audio_format.bits = 24;
|
audio_format.bits = 24;
|
||||||
}
|
|
||||||
|
|
||||||
if (!audio_format_valid(&audio_format)) {
|
if (!audio_format_valid(&audio_format)) {
|
||||||
g_warning("Invalid audio format: %u:%u:%u\n",
|
g_warning("Invalid audio format: %u:%u:%u\n",
|
||||||
|
|
Loading…
Reference in New Issue