MediaConverter: let the encoder make changes to the format

If the encoder decides to change the media format, we need to tell the
encoder as well so it uses the same format.
This commit is contained in:
Adrien Destugues 2014-12-23 15:48:18 +01:00
parent 5e0e16894d
commit 974595bc46

View File

@ -380,6 +380,10 @@ MediaConverterApp::_ConvertFile(BMediaFile* inFile, BMediaFile* outFile,
// audioFrameSize = (raf->format & 0xf) * raf->channel_count;
outAudTrack = outFile->CreateTrack(&outAudFormat, audioCodec);
// Negociate the format with the inTrack again in case the codec
// made some changes to it...
inTrack->DecodedFormat(&outAudFormat);
if (outAudTrack != NULL) {
if (outAudTrack->SetQuality(audioQuality / 100.0f) != B_OK
&& fWin->Lock()) {