зеркало из https://github.com/mozilla/gecko-dev.git
Bug 945645 - Only init WMF video decoding if we have a video container. r=padenot.
This commit is contained in:
Родитель
d8b99be219
Коммит
eb97868f09
|
@ -105,6 +105,7 @@ WMFReader::InitializeDXVA()
|
|||
if (!Preferences::GetBool("media.windows-media-foundation.use-dxva", false)) {
|
||||
return false;
|
||||
}
|
||||
MOZ_ASSERT(mDecoder->GetImageContainer());
|
||||
|
||||
// Extract the layer manager backend type so that we can determine
|
||||
// whether it's worthwhile using DXVA. If we're not running with a D3D
|
||||
|
@ -151,7 +152,8 @@ WMFReader::Init(MediaDecoderReader* aCloneDonor)
|
|||
rv = mByteStream->Init();
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
if (IsVideoContentType(mDecoder->GetResource()->GetContentType())) {
|
||||
if (mDecoder->GetImageContainer() != nullptr &&
|
||||
IsVideoContentType(mDecoder->GetResource()->GetContentType())) {
|
||||
mUseHwAccel = InitializeDXVA();
|
||||
} else {
|
||||
mUseHwAccel = false;
|
||||
|
@ -345,6 +347,11 @@ WMFReader::ConfigureVideoDecoder()
|
|||
return S_OK;
|
||||
}
|
||||
|
||||
if (!mDecoder->GetImageContainer()) {
|
||||
// We can't display the video, so don't bother to decode; disable the stream.
|
||||
return mSourceReader->SetStreamSelection(MF_SOURCE_READER_FIRST_VIDEO_STREAM, FALSE);
|
||||
}
|
||||
|
||||
static const GUID MP4VideoTypes[] = {
|
||||
MFVideoFormat_H264
|
||||
};
|
||||
|
|
Загрузка…
Ссылка в новой задаче