diff --git a/src/tests/kits/media/mp3_decoder_test/mp3_decoder_test.cpp b/src/tests/kits/media/mp3_decoder_test/mp3_decoder_test.cpp index b3c9c9dcdc..128e7399af 100644 --- a/src/tests/kits/media/mp3_decoder_test/mp3_decoder_test.cpp +++ b/src/tests/kits/media/mp3_decoder_test/mp3_decoder_test.cpp @@ -124,6 +124,27 @@ main(int argc, char* argv[]) { BApplication app("application/x-vnd.mp3-decoder-test"); + // TODO: The following code block is a workaround for the bug #11018 + // (https://dev.haiku-os.org/ticket/11018). Please remove this code block, + // once the bug is being resolved. + // The workaround triggers the loading of all media plugins prior to using + // methods of class BMediaFormats. Using the function get_next_encoder() + // is used because of two facts + // 1. It is publicly available and thus can be used by 3rd party apps, + // too. + // 2. It is already available by including BMediaFormats.h, so there is + // no need to include another header for this workaround. + // Also, please leave the workaround code at this -prominent- place + // instead of moving it to the more appropriate place in + // InitializeMp3DecodingCookie(). This way it acts as a reminder to fix + // the bug :) + int32 workaroundCookie = 0; + media_codec_info workaroundMediaCodecInfo; + status_t workaroundStatus = get_next_encoder(&workaroundCookie, + &workaroundMediaCodecInfo); + if (workaroundStatus < B_OK) + exit(99); + cookie_decode decodingCookie; if (InitializeMp3DecodingCookie(&decodingCookie) != B_OK) exit(1); @@ -226,7 +247,7 @@ CreateMp3MediaFormat() return sNoMp3MediaFormat; } - // The following code block can be removed, once the ffmpeg addon can + // TODO: The following code block can be removed, once the ffmpeg addon can // determine the codec output parameters from the encoded data. mp3MediaFormat->u.encoded_audio.output.frame_rate = 48000; mp3MediaFormat->u.encoded_audio.output.channel_count = 2;