Bug 1338086 - Remove useless else blocks in order to reduce complexity in dom/media r?jya
MozReview-Commit-ID: IA3oVcvzTQw
--- a/dom/media/DecoderTraits.cpp
+++ b/dom/media/DecoderTraits.cpp
@@ -96,52 +96,48 @@ CanHandleCodecsType(const MediaContainer
MOZ_ASSERT(aType.ExtendedType().HaveCodecs());
// Container type with the MIME type, no codecs.
const MediaContainerType mimeType(aType.Type());
if (OggDecoder::IsSupportedType(mimeType)) {
if (OggDecoder::IsSupportedType(aType)) {
return CANPLAY_YES;
- } else {
- // We can only reach this position if a particular codec was requested,
- // ogg is supported and working: the codec must be invalid.
- return CANPLAY_NO;
}
+ // We can only reach this position if a particular codec was requested,
+ // ogg is supported and working: the codec must be invalid.
+ return CANPLAY_NO;
}
if (WaveDecoder::IsSupportedType(MediaContainerType(mimeType))) {
if (WaveDecoder::IsSupportedType(aType)) {
return CANPLAY_YES;
- } else {
- // We can only reach this position if a particular codec was requested,
- // ogg is supported and working: the codec must be invalid.
- return CANPLAY_NO;
}
+ // We can only reach this position if a particular codec was requested,
+ // ogg is supported and working: the codec must be invalid.
+ return CANPLAY_NO;
}
#if !defined(MOZ_OMX_WEBM_DECODER)
if (WebMDecoder::IsSupportedType(mimeType)) {
if (WebMDecoder::IsSupportedType(aType)) {
return CANPLAY_YES;
- } else {
- // We can only reach this position if a particular codec was requested,
- // webm is supported and working: the codec must be invalid.
- return CANPLAY_NO;
}
+ // We can only reach this position if a particular codec was requested,
+ // webm is supported and working: the codec must be invalid.
+ return CANPLAY_NO;
}
#endif
#ifdef MOZ_FMP4
if (MP4Decoder::IsSupportedType(mimeType,
/* DecoderDoctorDiagnostics* */ nullptr)) {
if (MP4Decoder::IsSupportedType(aType, aDiagnostics)) {
return CANPLAY_YES;
- } else {
- // We can only reach this position if a particular codec was requested,
- // fmp4 is supported and working: the codec must be invalid.
- return CANPLAY_NO;
}
+ // We can only reach this position if a particular codec was requested,
+ // fmp4 is supported and working: the codec must be invalid.
+ return CANPLAY_NO;
}
#endif
if (MP3Decoder::IsSupportedType(aType)) {
return CANPLAY_YES;
}
if (ADTSDecoder::IsSupportedType(aType)) {
return CANPLAY_YES;
}
@@ -161,17 +157,16 @@ CanHandleCodecsType(const MediaContainer
if (supportedCodecs.IsEmpty()) {
return CANPLAY_MAYBE;
}
if (!supportedCodecs.ContainsAll(aType.ExtendedType().Codecs())) {
// At least one requested codec is not supported.
return CANPLAY_NO;
}
-
return CANPLAY_YES;
}
static
CanPlayStatus
CanHandleMediaType(const MediaContainerType& aType,
DecoderDoctorDiagnostics* aDiagnostics)
{