Bug 1237809: [h264] P1. Ensure correct video dimensions are passed to the decoder. r=cpearce

Dimensions are extracted from the SPS found in metadata if present.
This commit is contained in:
Jean-Yves Avenard 2016-01-09 02:34:07 +11:00
parent 23b425f2f7
commit c51d397d8c
2 changed files with 6 additions and 1 deletions

View File

@ -139,6 +139,11 @@ H264Converter::CreateDecoder()
return NS_ERROR_NOT_INITIALIZED;
}
UpdateConfigFromExtraData(mCurrentConfig.mExtraData);
if (!mNeedAVCC) {
// When using a decoder handling AnnexB, we get here only once from the
// constructor. We do want to get the dimensions extracted from the SPS.
mOriginalConfig = mCurrentConfig;
}
mDecoder = mPDM->CreateVideoDecoder(mNeedAVCC ? mCurrentConfig : mOriginalConfig,
mLayersBackend,

View File

@ -53,7 +53,7 @@ private:
void OnDecoderInitFailed(MediaDataDecoder::DecoderFailureReason aReason);
RefPtr<PlatformDecoderModule> mPDM;
const VideoInfo& mOriginalConfig;
VideoInfo mOriginalConfig;
VideoInfo mCurrentConfig;
layers::LayersBackend mLayersBackend;
RefPtr<layers::ImageContainer> mImageContainer;