Bug 1259212 - Small WMFDecoderModule::Supports refactoring - r?mattwoodrow
No actual code change intended. This will make the next patch easier to review.
MozReview-Commit-ID: BNkLomV04G7
--- a/dom/media/platforms/wmf/WMFDecoderModule.cpp
+++ b/dom/media/platforms/wmf/WMFDecoderModule.cpp
@@ -209,26 +209,28 @@ WMFDecoderModule::Supports(const TrackIn
if ((aTrackInfo.mMimeType.EqualsLiteral("audio/mp4a-latm") ||
aTrackInfo.mMimeType.EqualsLiteral("audio/mp4")) &&
WMFDecoderModule::HasAAC()) {
return true;
}
if (MP4Decoder::IsH264(aTrackInfo.mMimeType) && WMFDecoderModule::HasH264()) {
const VideoInfo* videoInfo = aTrackInfo.GetAsVideoInfo();
MOZ_ASSERT(videoInfo);
+ int32_t w = videoInfo->mImage.width;
+ int32_t h = videoInfo->mImage.height;
// Check Windows format constraints, based on:
// https://msdn.microsoft.com/en-us/library/windows/desktop/dd797815(v=vs.85).aspx
if (IsWin8OrLater()) {
// Windows >7 supports at most 4096x2304.
- if (videoInfo->mImage.width > 4096 || videoInfo->mImage.height > 2304) {
+ if (w > 4096 || h > 2304) {
return false;
}
} else {
// Windows <=7 supports at most 1920x1088.
- if (videoInfo->mImage.width > 1920 || videoInfo->mImage.height > 1088) {
+ if (w > 1920 || h > 1088) {
return false;
}
}
return true;
}
if (aTrackInfo.mMimeType.EqualsLiteral("audio/mpeg") &&
CanCreateWMFDecoder<CLSID_CMP3DecMediaObject>()) {
return true;