From 05116a366a4596450e9d8df85ed630cb901310a8 Mon Sep 17 00:00:00 2001 From: shatty Date: Sun, 25 Jan 2004 21:33:28 +0000 Subject: [PATCH] do not fail if GetFormatFor fails, instead spit out a TRACE message and then use a default format, with the user_data field populated so that MediaPlayer can give a somewhat helpful error message git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6303 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../media/plugins/mp3_reader/MP3ReaderPlugin.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/add-ons/media/plugins/mp3_reader/MP3ReaderPlugin.cpp b/src/add-ons/media/plugins/mp3_reader/MP3ReaderPlugin.cpp index 6d6e8f9dc9..74bec914ef 100644 --- a/src/add-ons/media/plugins/mp3_reader/MP3ReaderPlugin.cpp +++ b/src/add-ons/media/plugins/mp3_reader/MP3ReaderPlugin.cpp @@ -243,12 +243,15 @@ mp3Reader::AllocateCookie(int32 streamNumber, void **cookie) BMediaFormats formats; status_t result = formats.InitCheck(); - if (result != B_OK) { - return result; + if (result == B_OK) { + result = formats.GetFormatFor(description, &data->format); } - result = formats.GetFormatFor(description, &data->format); if (result != B_OK) { - return result; + TRACE("mp3Reader::AllocateCookie: Unable to GetFormatFor mpeg description\n"); + // ignore error result, use default format + data->format.type = B_MEDIA_ENCODED_AUDIO; + data->format.user_data_type = B_CODEC_TYPE_INFO; + strncpy((char*)data->format.user_data, "mpeg", 4); } data->format.u.encoded_audio.bit_rate = bit_rate;