diff options
| author | LukePulverenti Luke Pulverenti luke pulverenti <LukePulverenti Luke Pulverenti luke.pulverenti@gmail.com> | 2012-08-25 11:30:37 -0400 |
|---|---|---|
| committer | LukePulverenti Luke Pulverenti luke pulverenti <LukePulverenti Luke Pulverenti luke.pulverenti@gmail.com> | 2012-08-25 11:30:37 -0400 |
| commit | 37dd0c8bdde20ce83e95a638f913dbfd7ae41f85 (patch) | |
| tree | fc92bdacdc46f9dd384ef1865c2e5b1e95c47537 /MediaBrowser.Controller/Providers/AudioInfoProvider.cs | |
| parent | bbbe6164dc592cbeb934cf398dca0044e7b2f77e (diff) | |
Added some ffprobe error handling
Diffstat (limited to 'MediaBrowser.Controller/Providers/AudioInfoProvider.cs')
| -rw-r--r-- | MediaBrowser.Controller/Providers/AudioInfoProvider.cs | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/MediaBrowser.Controller/Providers/AudioInfoProvider.cs b/MediaBrowser.Controller/Providers/AudioInfoProvider.cs index ce0759715e..709589cdb4 100644 --- a/MediaBrowser.Controller/Providers/AudioInfoProvider.cs +++ b/MediaBrowser.Controller/Providers/AudioInfoProvider.cs @@ -26,12 +26,6 @@ namespace MediaBrowser.Controller.Providers protected override void Fetch(Audio audio, FFProbeResult data)
{
- if (data == null)
- {
- Logger.LogInfo("Null FFProbeResult for {0} {1}", audio.Id, audio.Name);
- return;
- }
-
MediaStream stream = data.streams.First(s => s.codec_type.Equals("audio", StringComparison.OrdinalIgnoreCase));
string bitrate = null;
@@ -176,16 +170,25 @@ namespace MediaBrowser.Controller.Providers FFProbeResult result = FFProbe.Run(myItem, CacheDirectory);
- if (result.format.tags != null)
+ if (result == null)
+ {
+ Logger.LogInfo("Null FFProbeResult for {0} {1}", item.Id, item.Name);
+ return;
+ }
+
+ if (result.format != null && result.format.tags != null)
{
result.format.tags = ConvertDictionaryToCaseInSensitive(result.format.tags);
}
- foreach (MediaStream stream in result.streams)
+ if (result.streams != null)
{
- if (stream.tags != null)
+ foreach (MediaStream stream in result.streams)
{
- stream.tags = ConvertDictionaryToCaseInSensitive(stream.tags);
+ if (stream.tags != null)
+ {
+ stream.tags = ConvertDictionaryToCaseInSensitive(stream.tags);
+ }
}
}
|
