aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.MediaEncoding/Probing/FFProbeHelpers.cs
diff options
context:
space:
mode:
authordkanada <dkanada@users.noreply.github.com>2020-01-09 15:10:29 +0900
committerGitHub <noreply@github.com>2020-01-09 15:10:29 +0900
commit162c1ac7b7fde0e4929cf262b0f275e3eb15524c (patch)
tree18283951ed26d9c5190ff8226a0269fe388643cd /MediaBrowser.MediaEncoding/Probing/FFProbeHelpers.cs
parent124a852787ff94201de452a952eb31376beafe12 (diff)
parentb1af8a4178b5d993b09e5682a0149ea37766ff91 (diff)
Merge pull request #2185 from Bond-009/scanerrors
Fix exceptions while scanning
Diffstat (limited to 'MediaBrowser.MediaEncoding/Probing/FFProbeHelpers.cs')
-rw-r--r--MediaBrowser.MediaEncoding/Probing/FFProbeHelpers.cs21
1 files changed, 8 insertions, 13 deletions
diff --git a/MediaBrowser.MediaEncoding/Probing/FFProbeHelpers.cs b/MediaBrowser.MediaEncoding/Probing/FFProbeHelpers.cs
index e4eabaf38..78dc7b607 100644
--- a/MediaBrowser.MediaEncoding/Probing/FFProbeHelpers.cs
+++ b/MediaBrowser.MediaEncoding/Probing/FFProbeHelpers.cs
@@ -16,24 +16,19 @@ namespace MediaBrowser.MediaEncoding.Probing
throw new ArgumentNullException(nameof(result));
}
- if (result.format != null && result.format.tags != null)
+ if (result.Format != null && result.Format.Tags != null)
{
- result.format.tags = ConvertDictionaryToCaseInSensitive(result.format.tags);
+ result.Format.Tags = ConvertDictionaryToCaseInsensitive(result.Format.Tags);
}
- if (result.streams != null)
+ if (result.Streams != null)
{
// Convert all dictionaries to case insensitive
- foreach (var stream in result.streams)
+ foreach (var stream in result.Streams)
{
- if (stream.tags != null)
+ if (stream.Tags != null)
{
- stream.tags = ConvertDictionaryToCaseInSensitive(stream.tags);
- }
-
- if (stream.disposition != null)
- {
- stream.disposition = ConvertDictionaryToCaseInSensitive(stream.disposition);
+ stream.Tags = ConvertDictionaryToCaseInsensitive(stream.Tags);
}
}
}
@@ -45,7 +40,7 @@ namespace MediaBrowser.MediaEncoding.Probing
/// <param name="tags">The tags.</param>
/// <param name="key">The key.</param>
/// <returns>System.String.</returns>
- public static string GetDictionaryValue(Dictionary<string, string> tags, string key)
+ public static string GetDictionaryValue(IReadOnlyDictionary<string, string> tags, string key)
{
if (tags == null)
{
@@ -103,7 +98,7 @@ namespace MediaBrowser.MediaEncoding.Probing
/// </summary>
/// <param name="dict">The dict.</param>
/// <returns>Dictionary{System.StringSystem.String}.</returns>
- private static Dictionary<string, string> ConvertDictionaryToCaseInSensitive(Dictionary<string, string> dict)
+ private static Dictionary<string, string> ConvertDictionaryToCaseInsensitive(IReadOnlyDictionary<string, string> dict)
{
return new Dictionary<string, string>(dict, StringComparer.OrdinalIgnoreCase);
}