aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2013-05-15 00:05:52 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2013-05-15 00:05:52 -0400
commite6b57e264cf6b4e92d873f24eaf1664bcf007ecc (patch)
tree4701029f43e6c9b367c65d4707416cb062471a76
parent0adf788c400e5a25ef50ea97d189cc3c9b8e397c (diff)
fixes #238 - MBServer Client Theme Background
-rw-r--r--MediaBrowser.Controller/Providers/MediaInfo/FFProbeAudioInfoProvider.cs27
1 files changed, 15 insertions, 12 deletions
diff --git a/MediaBrowser.Controller/Providers/MediaInfo/FFProbeAudioInfoProvider.cs b/MediaBrowser.Controller/Providers/MediaInfo/FFProbeAudioInfoProvider.cs
index 45ee732dd..e6d74907f 100644
--- a/MediaBrowser.Controller/Providers/MediaInfo/FFProbeAudioInfoProvider.cs
+++ b/MediaBrowser.Controller/Providers/MediaInfo/FFProbeAudioInfoProvider.cs
@@ -44,21 +44,24 @@ namespace MediaBrowser.Controller.Providers.MediaInfo
.ToList();
// Get the first audio stream
- var stream = data.streams.First(s => s.codec_type.Equals("audio", StringComparison.OrdinalIgnoreCase));
+ var stream = data.streams.FirstOrDefault(s => s.codec_type.Equals("audio", StringComparison.OrdinalIgnoreCase));
- // Get duration from stream properties
- var duration = stream.duration;
-
- // If it's not there go into format properties
- if (string.IsNullOrEmpty(duration))
+ if (stream != null)
{
- duration = data.format.duration;
- }
+ // Get duration from stream properties
+ var duration = stream.duration;
- // If we got something, parse it
- if (!string.IsNullOrEmpty(duration))
- {
- audio.RunTimeTicks = TimeSpan.FromSeconds(double.Parse(duration, UsCulture)).Ticks;
+ // If it's not there go into format properties
+ if (string.IsNullOrEmpty(duration))
+ {
+ duration = data.format.duration;
+ }
+
+ // If we got something, parse it
+ if (!string.IsNullOrEmpty(duration))
+ {
+ audio.RunTimeTicks = TimeSpan.FromSeconds(double.Parse(duration, UsCulture)).Ticks;
+ }
}
if (data.format.tags != null)