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
This commit is contained in:
parent
4d8c3e52a9
commit
05116a366a
@ -243,12 +243,15 @@ mp3Reader::AllocateCookie(int32 streamNumber, void **cookie)
|
|||||||
|
|
||||||
BMediaFormats formats;
|
BMediaFormats formats;
|
||||||
status_t result = formats.InitCheck();
|
status_t result = formats.InitCheck();
|
||||||
if (result != B_OK) {
|
if (result == B_OK) {
|
||||||
return result;
|
result = formats.GetFormatFor(description, &data->format);
|
||||||
}
|
}
|
||||||
result = formats.GetFormatFor(description, &data->format);
|
|
||||||
if (result != B_OK) {
|
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;
|
data->format.u.encoded_audio.bit_rate = bit_rate;
|
||||||
|
Loading…
Reference in New Issue
Block a user