mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-17 15:25:52 +00:00
Bug 1409664 - P15. Fix canPlayType so that it checks codecs if provided. r=bryce
Summary: For flac, mp3 and adts, if a codec was provided but wasn't supported in the container, it would have reported Maybe instead of No Depends on D1628 Tags: #secure-revision Bug #: 1409664 Differential Revision: https://phabricator.services.mozilla.com/D1629
This commit is contained in:
parent
88f93633b1
commit
b763f84cf1
@ -121,15 +121,30 @@ CanHandleCodecsType(const MediaContainerType& aType,
|
||||
return CANPLAY_NO;
|
||||
}
|
||||
#endif
|
||||
if (MP3Decoder::IsSupportedType(mimeType)) {
|
||||
if (MP3Decoder::IsSupportedType(aType)) {
|
||||
return CANPLAY_YES;
|
||||
}
|
||||
// We can only reach this position if a particular codec was requested,
|
||||
// mp3 is supported and working: the codec must be invalid.
|
||||
return CANPLAY_NO;
|
||||
}
|
||||
if (ADTSDecoder::IsSupportedType(mimeType)) {
|
||||
if (ADTSDecoder::IsSupportedType(aType)) {
|
||||
return CANPLAY_YES;
|
||||
}
|
||||
// We can only reach this position if a particular codec was requested,
|
||||
// adts is supported and working: the codec must be invalid.
|
||||
return CANPLAY_NO;
|
||||
}
|
||||
if (FlacDecoder::IsSupportedType(mimeType)) {
|
||||
if (FlacDecoder::IsSupportedType(aType)) {
|
||||
return CANPLAY_YES;
|
||||
}
|
||||
// We can only reach this position if a particular codec was requested,
|
||||
// flac is supported and working: the codec must be invalid.
|
||||
return CANPLAY_NO;
|
||||
}
|
||||
|
||||
return CANPLAY_MAYBE;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user