mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-24 16:17:29 +09:00
Make matroska mime type checking more consistent.
This commit is contained in:
parent
a960d679d5
commit
68c810a1ac
4 changed files with 10 additions and 5 deletions
|
|
@ -697,7 +697,7 @@ ContainerParser::CreateForMIMEType(const nsACString& aType)
|
||||||
if (aType.LowerCaseEqualsLiteral("video/webm") || aType.LowerCaseEqualsLiteral("audio/webm")) {
|
if (aType.LowerCaseEqualsLiteral("video/webm") || aType.LowerCaseEqualsLiteral("audio/webm")) {
|
||||||
return new WebMContainerParser(aType);
|
return new WebMContainerParser(aType);
|
||||||
}
|
}
|
||||||
if (aType.LowerCaseEqualsLiteral("video/x-matroska")) {
|
if (aType.LowerCaseEqualsLiteral("video/x-matroska") || aType.LowerCaseEqualsLiteral("audio/x-matroska")) {
|
||||||
return new WebMContainerParser(aType);
|
return new WebMContainerParser(aType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -118,7 +118,8 @@ MediaSource::IsTypeSupported(const nsAString& aType, DecoderDoctorDiagnostics* a
|
||||||
}
|
}
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
if (mimeType.EqualsASCII("audio/webm")) {
|
if (mimeType.EqualsASCII("audio/webm") ||
|
||||||
|
mimeType.EqualsASCII("audio/x-matroska")) {
|
||||||
if (!(Preferences::GetBool("media.mediasource.webm.enabled", false) ||
|
if (!(Preferences::GetBool("media.mediasource.webm.enabled", false) ||
|
||||||
Preferences::GetBool("media.mediasource.webm.audio.enabled", true))) {
|
Preferences::GetBool("media.mediasource.webm.audio.enabled", true))) {
|
||||||
return NS_ERROR_DOM_NOT_SUPPORTED_ERR;
|
return NS_ERROR_DOM_NOT_SUPPORTED_ERR;
|
||||||
|
|
|
||||||
|
|
@ -815,6 +815,7 @@ TrackBuffersManager::CreateDemuxerforMIMEType()
|
||||||
|
|
||||||
if (mType.LowerCaseEqualsLiteral("video/webm") ||
|
if (mType.LowerCaseEqualsLiteral("video/webm") ||
|
||||||
mType.LowerCaseEqualsLiteral("video/x-matroska") ||
|
mType.LowerCaseEqualsLiteral("video/x-matroska") ||
|
||||||
|
mType.LowerCaseEqualsLiteral("audio/x-matroska") ||
|
||||||
mType.LowerCaseEqualsLiteral("audio/webm")) {
|
mType.LowerCaseEqualsLiteral("audio/webm")) {
|
||||||
mInputDemuxer = new WebMDemuxer(mCurrentInputBuffer, true /* IsMediaSource*/ );
|
mInputDemuxer = new WebMDemuxer(mCurrentInputBuffer, true /* IsMediaSource*/ );
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -41,8 +41,11 @@ WebMDecoder::CanHandleMediaType(const nsACString& aMIMETypeExcludingCodecs,
|
||||||
}
|
}
|
||||||
|
|
||||||
const bool isWebMAudio = aMIMETypeExcludingCodecs.EqualsASCII("audio/webm");
|
const bool isWebMAudio = aMIMETypeExcludingCodecs.EqualsASCII("audio/webm");
|
||||||
const bool isWebMVideo = aMIMETypeExcludingCodecs.EqualsASCII("video/webm") || aMIMETypeExcludingCodecs.EqualsASCII("video/x-matroska") ;
|
const bool isWebMVideo = aMIMETypeExcludingCodecs.EqualsASCII("video/webm");
|
||||||
if (!isWebMAudio && !isWebMVideo) {
|
const bool isMatroskaAudio = aMIMETypeExcludingCodecs.EqualsASCII("audio/x-matroska") ;
|
||||||
|
const bool isMatroskaVideo = aMIMETypeExcludingCodecs.EqualsASCII("video/x-matroska") ;
|
||||||
|
|
||||||
|
if (!isWebMAudio && !isWebMVideo && !isMatroskaAudio && !isMatroskaVideo) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -63,7 +66,7 @@ WebMDecoder::CanHandleMediaType(const nsACString& aMIMETypeExcludingCodecs,
|
||||||
}
|
}
|
||||||
// Note: Only accept VP8/VP9 in a video content type, not in an audio
|
// Note: Only accept VP8/VP9 in a video content type, not in an audio
|
||||||
// content type.
|
// content type.
|
||||||
if (isWebMVideo &&
|
if ((isWebMVideo || isMatroskaVideo) &&
|
||||||
(codec.EqualsLiteral("vp8") || codec.EqualsLiteral("vp8.0") ||
|
(codec.EqualsLiteral("vp8") || codec.EqualsLiteral("vp8.0") ||
|
||||||
codec.EqualsLiteral("vp9") || codec.EqualsLiteral("vp9.0"))) {
|
codec.EqualsLiteral("vp9") || codec.EqualsLiteral("vp9.0"))) {
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue