aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs
diff options
context:
space:
mode:
authorJoe Rogers <1337joe@gmail.com>2021-10-07 22:37:59 +0200
committerJoe Rogers <1337joe@gmail.com>2021-10-11 14:09:02 +0200
commit8d70cc2dde81aad0f484a2f0d0c5b90e6e1b97cd (patch)
treee11c78d463fca103cb122f3321e6b6b95ec77bf1 /MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs
parent6ce8cce12c8d24cc0a49aac7a0d371e5ebf1b3a3 (diff)
Add support for non-jpg image extractions
Diffstat (limited to 'MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs')
-rw-r--r--MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs18
1 files changed, 6 insertions, 12 deletions
diff --git a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs
index 5f6539495..775689095 100644
--- a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs
+++ b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs
@@ -582,7 +582,8 @@ namespace MediaBrowser.MediaEncoding.Probing
/// <returns>MediaAttachments.</returns>
private MediaAttachment GetMediaAttachment(MediaStreamInfo streamInfo)
{
- if (!string.Equals(streamInfo.CodecType, "attachment", StringComparison.OrdinalIgnoreCase))
+ if (!string.Equals(streamInfo.CodecType, "attachment", StringComparison.OrdinalIgnoreCase) &&
+ !(streamInfo.Disposition != null && streamInfo.Disposition.GetValueOrDefault("attached_pic") == 1))
{
return null;
}
@@ -735,15 +736,14 @@ namespace MediaBrowser.MediaEncoding.Probing
else if (string.Equals(stream.Codec, "mjpeg", StringComparison.OrdinalIgnoreCase))
{
// How to differentiate between video and embedded image?
- // check disposition, alternately: presence of codec tag, also embedded images have high (unusual) framerates
- if ((streamInfo.Disposition != null && streamInfo.Disposition.GetValueOrDefault("attached_pic") == 1) ||
- string.IsNullOrWhiteSpace(stream.CodecTag))
+ // The only difference I've seen thus far is presence of codec tag, also embedded images have high (unusual) framerates
+ if (!string.IsNullOrWhiteSpace(stream.CodecTag))
{
- stream.Type = MediaStreamType.EmbeddedImage;
+ stream.Type = MediaStreamType.Video;
}
else
{
- stream.Type = MediaStreamType.Video;
+ stream.Type = MediaStreamType.EmbeddedImage;
}
}
else
@@ -812,12 +812,6 @@ namespace MediaBrowser.MediaEncoding.Probing
{
stream.ColorPrimaries = streamInfo.ColorPrimaries;
}
-
- // workaround for mkv attached_pics losing filename due to being classified as video based on codec
- if (stream.Type == MediaStreamType.EmbeddedImage && streamInfo.Tags != null && string.IsNullOrEmpty(stream.Comment))
- {
- stream.Comment = GetDictionaryValue(streamInfo.Tags, "filename");
- }
}
else
{