decoder/pcm: add MIME type "audio/x-mpd-float"
This commit is contained in:
parent
5a22a0c27d
commit
22ff0d80ce
2
NEWS
2
NEWS
|
@ -23,7 +23,7 @@ ver 0.20 (not yet released)
|
|||
- gme: add option "accuracy"
|
||||
- mad: reduce memory usage while scanning tags
|
||||
- mpcdec: read the bit rate
|
||||
- pcm: support audio/L16 (RFC 2586)
|
||||
- pcm: support audio/L16 (RFC 2586) and audio/x-mpd-float
|
||||
* playlist
|
||||
- cue: don't skip pregap
|
||||
- embcue: fix last track
|
||||
|
|
|
@ -1944,7 +1944,9 @@ buffer_size: 16384</programlisting>
|
|||
<para>
|
||||
Read raw PCM samples. It understands the "audio/L16" MIME
|
||||
type with parameters "rate" and "channels" according to RFC
|
||||
2586.
|
||||
2586. It also understands the
|
||||
<application>MPD</application>-specific MIME type
|
||||
"audio/x-mpd-float".
|
||||
</para>
|
||||
</section>
|
||||
|
||||
|
|
|
@ -45,11 +45,16 @@ pcm_stream_decode(Decoder &decoder, InputStream &is)
|
|||
|
||||
const bool l16 = mime != nullptr &&
|
||||
GetMimeTypeBase(mime) == "audio/L16";
|
||||
if (l16) {
|
||||
const bool is_float = mime != nullptr &&
|
||||
GetMimeTypeBase(mime) == "audio/x-mpd-float";
|
||||
if (l16 || is_float) {
|
||||
audio_format.sample_rate = 0;
|
||||
audio_format.channels = 1;
|
||||
}
|
||||
|
||||
if (is_float)
|
||||
audio_format.format = SampleFormat::FLOAT;
|
||||
|
||||
{
|
||||
const auto mime_parameters = ParseMimeTypeParameters(mime);
|
||||
Error error;
|
||||
|
@ -154,6 +159,9 @@ static const char *const pcm_mime_types[] = {
|
|||
/* RFC 2586 */
|
||||
"audio/L16",
|
||||
|
||||
/* MPD-specific: float32 native-endian */
|
||||
"audio/x-mpd-float",
|
||||
|
||||
/* for streams obtained by the cdio_paranoia input plugin */
|
||||
"audio/x-mpd-cdda-pcm",
|
||||
|
||||
|
|
Loading…
Reference in New Issue