diff options
| author | Luke <luke.pulverenti@gmail.com> | 2015-06-15 00:28:29 -0400 |
|---|---|---|
| committer | Luke <luke.pulverenti@gmail.com> | 2015-06-15 00:28:29 -0400 |
| commit | 7d9d57a36ecee8e8a74b92544166c8fe70a0f880 (patch) | |
| tree | a7f8a6bdb038048449d45a1e8926843015886f97 /MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs | |
| parent | 5aafbe3dd694813a4e68f21ee72e59d6c53e776a (diff) | |
| parent | 55eb54cbc28e40254a50c5a25443e910798243dc (diff) | |
Merge pull request #1118 from MediaBrowser/dev
3.0.5641.4
Diffstat (limited to 'MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs')
| -rw-r--r-- | MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs index 6ca489f6d..33b703611 100644 --- a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs +++ b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs @@ -56,10 +56,33 @@ namespace MediaBrowser.MediaEncoding.Probing { SetAudioRuntimeTicks(data, info); + var tags = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase); + + // tags are normally located under data.format, but we've seen some cases with ogg where they're part of the audio stream + // so let's create a combined list of both + + if (data.streams != null) + { + var audioStream = data.streams.FirstOrDefault(i => string.Equals(i.codec_type, "audio", StringComparison.OrdinalIgnoreCase)); + + if (audioStream != null && audioStream.tags != null) + { + foreach (var pair in audioStream.tags) + { + tags[pair.Key] = pair.Value; + } + } + } + if (data.format != null && data.format.tags != null) { - SetAudioInfoFromTags(info, data.format.tags); + foreach (var pair in data.format.tags) + { + tags[pair.Key] = pair.Value; + } } + + SetAudioInfoFromTags(info, tags); } else { |
