aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs')
-rw-r--r--MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs46
1 files changed, 43 insertions, 3 deletions
diff --git a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs
index 3139392b0..44a0f264d 100644
--- a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs
+++ b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs
@@ -138,10 +138,14 @@ namespace MediaBrowser.MediaEncoding.Probing
var parts = iTunEXTC.Split(new[] { '|' }, StringSplitOptions.RemoveEmptyEntries);
// Example
// mpaa|G|100|For crude humor
- if (parts.Length == 4)
+ if (parts.Length > 1)
{
info.OfficialRating = parts[1];
- info.OfficialRatingDescription = parts[3];
+
+ if (parts.Length > 3)
+ {
+ info.OfficialRatingDescription = parts[3];
+ }
}
}
@@ -403,9 +407,23 @@ namespace MediaBrowser.MediaEncoding.Probing
Profile = streamInfo.profile,
Level = streamInfo.level,
Index = streamInfo.index,
- PixelFormat = streamInfo.pix_fmt
+ PixelFormat = streamInfo.pix_fmt,
+ NalLengthSize = streamInfo.nal_length_size,
+ TimeBase = streamInfo.time_base,
+ CodecTimeBase = streamInfo.codec_time_base
};
+ if (string.Equals(streamInfo.is_avc, "true", StringComparison.OrdinalIgnoreCase) ||
+ string.Equals(streamInfo.is_avc, "1", StringComparison.OrdinalIgnoreCase))
+ {
+ stream.IsAVC = true;
+ }
+ else if (string.Equals(streamInfo.is_avc, "false", StringComparison.OrdinalIgnoreCase) ||
+ string.Equals(streamInfo.is_avc, "0", StringComparison.OrdinalIgnoreCase))
+ {
+ stream.IsAVC = false;
+ }
+
// Filter out junk
if (!string.IsNullOrWhiteSpace(streamInfo.codec_tag_string) && streamInfo.codec_tag_string.IndexOf("[0]", StringComparison.OrdinalIgnoreCase) == -1)
{
@@ -416,6 +434,7 @@ namespace MediaBrowser.MediaEncoding.Probing
{
stream.Language = GetDictionaryValue(streamInfo.tags, "language");
stream.Comment = GetDictionaryValue(streamInfo.tags, "comment");
+ stream.Title = GetDictionaryValue(streamInfo.tags, "title");
}
if (string.Equals(streamInfo.codec_type, "audio", StringComparison.OrdinalIgnoreCase))
@@ -524,9 +543,25 @@ namespace MediaBrowser.MediaEncoding.Probing
stream.IsForced = string.Equals(isForced, "1", StringComparison.OrdinalIgnoreCase);
}
+ NormalizeStreamTitle(stream);
+
return stream;
}
+ private void NormalizeStreamTitle(MediaStream stream)
+ {
+ if (string.Equals(stream.Title, "sdh", StringComparison.OrdinalIgnoreCase) ||
+ string.Equals(stream.Title, "cc", StringComparison.OrdinalIgnoreCase))
+ {
+ stream.Title = null;
+ }
+
+ if (stream.Type == MediaStreamType.EmbeddedImage)
+ {
+ stream.Title = null;
+ }
+ }
+
/// <summary>
/// Gets a string from an FFProbeResult tags dictionary
/// </summary>
@@ -791,6 +826,11 @@ namespace MediaBrowser.MediaEncoding.Probing
}
+ if (audio.AlbumArtists.Count == 0)
+ {
+ audio.AlbumArtists = audio.Artists.Take(1).ToList();
+ }
+
// Track number
audio.IndexNumber = GetDictionaryDiscValue(tags, "track");