From bc98a767932db4f729dd60f612580a6c7dc092da Mon Sep 17 00:00:00 2001 From: beveloper Date: Sat, 24 Jan 2004 16:58:18 +0000 Subject: [PATCH] added MP3 in WAV format IDs git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6255 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../media/plugins/mp3_decoder/mp3DecoderPlugin.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/add-ons/media/plugins/mp3_decoder/mp3DecoderPlugin.cpp b/src/add-ons/media/plugins/mp3_decoder/mp3DecoderPlugin.cpp index f663600434..6b8cd9aee0 100644 --- a/src/add-ons/media/plugins/mp3_decoder/mp3DecoderPlugin.cpp +++ b/src/add-ons/media/plugins/mp3_decoder/mp3DecoderPlugin.cpp @@ -86,7 +86,7 @@ void mp3Decoder::GetCodecInfo(media_codec_info &info) { strcpy(info.short_name, "mp3"); - strcpy(info.pretty_name, "MPEG 1/2.5 audio layer 1/2/3 decoder, based on mpeg123 mpglib"); + strcpy(info.pretty_name, "MPEG 1/2/2.5 audio layer 1/2/3 decoder, based on mpeg123 mpglib"); // ToDo: could alter the above string depending on the real format } @@ -356,14 +356,18 @@ mp3DecoderPlugin::RegisterDecoder() B_MPEG_2_5_AUDIO_LAYER_2, B_MPEG_2_5_AUDIO_LAYER_3, }; - const size_t numIDs = sizeof(ids) / sizeof(mpeg_id); + const size_t numIDs = 2 + sizeof(ids) / sizeof(mpeg_id); media_format_description descriptions[numIDs]; - for (size_t i = 0; i < numIDs; i++) { + descriptions[0].family = B_WAV_FORMAT_FAMILY; + descriptions[0].u.wav.codec = 0x0050; + descriptions[1].family = B_WAV_FORMAT_FAMILY; + descriptions[1].u.wav.codec = 0x0055; + for (size_t i = 2; i < numIDs; i++) { descriptions[i].family = B_MPEG_FORMAT_FAMILY; descriptions[i].u.mpeg.id = ids[i]; } - + media_format format; format.type = B_MEDIA_ENCODED_AUDIO; format.u.encoded_audio = media_encoded_audio_format::wildcard;