mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-04-24 14:08:44 -04:00
Never treat matroska as webm for audio playback
This would break browsers like Firefox where the matroska file cannot be played as audio file.
This commit is contained in:
parent
5c6317f68d
commit
cc9c000412
1 changed files with 22 additions and 11 deletions
|
@ -2249,7 +2249,7 @@ namespace MediaBrowser.Model.Dlna
|
|||
}
|
||||
}
|
||||
|
||||
private static bool IsAudioDirectPlaySupported(DirectPlayProfile profile, MediaSourceInfo item, MediaStream audioStream)
|
||||
private static bool IsAudioContainerSupported(DirectPlayProfile profile, MediaSourceInfo item)
|
||||
{
|
||||
// Check container type
|
||||
if (!profile.SupportsContainer(item.Container))
|
||||
|
@ -2257,6 +2257,20 @@ namespace MediaBrowser.Model.Dlna
|
|||
return false;
|
||||
}
|
||||
|
||||
// Never direct play audio in matroska when the device only declare support for webm.
|
||||
// The first check is not enough because mkv is assumed can be webm.
|
||||
// See https://github.com/jellyfin/jellyfin/issues/13344
|
||||
return !ContainerHelper.ContainsContainer("mkv", item.Container)
|
||||
|| profile.SupportsContainer("mkv");
|
||||
}
|
||||
|
||||
private static bool IsAudioDirectPlaySupported(DirectPlayProfile profile, MediaSourceInfo item, MediaStream audioStream)
|
||||
{
|
||||
if (!IsAudioContainerSupported(profile, item))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check audio codec
|
||||
string? audioCodec = audioStream?.Codec;
|
||||
if (!profile.SupportsAudioCodec(audioCodec))
|
||||
|
@ -2271,19 +2285,16 @@ namespace MediaBrowser.Model.Dlna
|
|||
{
|
||||
// Check container type, this should NOT be supported
|
||||
// If the container is supported, the file should be directly played
|
||||
if (!profile.SupportsContainer(item.Container))
|
||||
if (IsAudioContainerSupported(profile, item))
|
||||
{
|
||||
// Check audio codec, we cannot use the SupportsAudioCodec here
|
||||
// Because that one assumes empty container supports all codec, which is just useless
|
||||
string? audioCodec = audioStream?.Codec;
|
||||
if (string.Equals(profile.AudioCodec, audioCodec, StringComparison.OrdinalIgnoreCase) ||
|
||||
string.Equals(profile.Container, audioCodec, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
// Check audio codec, we cannot use the SupportsAudioCodec here
|
||||
// Because that one assumes empty container supports all codec, which is just useless
|
||||
string? audioCodec = audioStream?.Codec;
|
||||
return string.Equals(profile.AudioCodec, audioCodec, StringComparison.OrdinalIgnoreCase)
|
||||
|| string.Equals(profile.Container, audioCodec, StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
private int GetRank(ref TranscodeReason a, TranscodeReason[] rankings)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue