might work better
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1791 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -109,22 +109,31 @@ BTrackReader::SetToTrack(BMediaTrack *track)
|
|||||||
memset(&fmt,0,sizeof(fmt)); //wildcard
|
memset(&fmt,0,sizeof(fmt)); //wildcard
|
||||||
memcpy(&fmt.u.raw_audio,&fFormat,sizeof(fFormat));
|
memcpy(&fmt.u.raw_audio,&fFormat,sizeof(fFormat));
|
||||||
fmt.type = B_MEDIA_RAW_AUDIO;
|
fmt.type = B_MEDIA_RAW_AUDIO;
|
||||||
|
|
||||||
//try to find a output format
|
//try to find a output format
|
||||||
if (B_OK == track->DecodedFormat(&fmt)) {
|
if (B_OK == track->DecodedFormat(&fmt)) {
|
||||||
memcpy(&fFormat,&fmt.u.raw_audio,sizeof(fFormat));
|
memcpy(&fFormat,&fmt.u.raw_audio,sizeof(fFormat));
|
||||||
fMediaTrack = track;
|
fMediaTrack = track;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//try again
|
//try again
|
||||||
fmt.u.raw_audio.buffer_size = 0;
|
fmt.u.raw_audio.buffer_size = 2 * 4096;
|
||||||
|
fmt.u.raw_audio.format = media_raw_audio_format::B_AUDIO_FLOAT;
|
||||||
if (B_OK == track->DecodedFormat(&fmt)) {
|
if (B_OK == track->DecodedFormat(&fmt)) {
|
||||||
memcpy(&fFormat,&fmt.u.raw_audio,sizeof(fFormat));
|
memcpy(&fFormat,&fmt.u.raw_audio,sizeof(fFormat));
|
||||||
fMediaTrack = track;
|
fMediaTrack = track;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//try again
|
||||||
|
fmt.u.raw_audio.buffer_size = 4096;
|
||||||
|
fmt.u.raw_audio.format = media_raw_audio_format::B_AUDIO_SHORT;
|
||||||
|
if (B_OK == track->DecodedFormat(&fmt)) {
|
||||||
|
memcpy(&fFormat,&fmt.u.raw_audio,sizeof(fFormat));
|
||||||
|
fMediaTrack = track;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
//we have failed
|
//we have failed
|
||||||
TRACE("BTrackReader::SetToTrack failed\n");
|
TRACE("BTrackReader::SetToTrack failed\n");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user