aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs
diff options
context:
space:
mode:
authorLuke <luke.pulverenti@gmail.com>2015-10-30 11:29:10 -0400
committerLuke <luke.pulverenti@gmail.com>2015-10-30 11:29:10 -0400
commit5b4cb77858d3c19bc512dc526ab02f4e597a1a69 (patch)
tree6dfae6a6731093cc7c308efa74cca2e076f2b2a2 /MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs
parent50f6ee1039cf0f51aa64e5f55949f0eaa41e44d3 (diff)
parenta050f20ac5ce37ce501d399346a5be40054da7f4 (diff)
Merge pull request #1239 from MediaBrowser/master
merge from master
Diffstat (limited to 'MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs')
-rw-r--r--MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs36
1 files changed, 21 insertions, 15 deletions
diff --git a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs
index 56ce6b6d6..ddcd48b8b 100644
--- a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs
+++ b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs
@@ -189,6 +189,11 @@ namespace MediaBrowser.MediaEncoding.Probing
// http://stackoverflow.com/questions/17353387/how-to-detect-anamorphic-video-with-ffprobe
stream.IsAnamorphic = string.Equals(streamInfo.sample_aspect_ratio, "0:1", StringComparison.OrdinalIgnoreCase);
+
+ if (streamInfo.refs > 0)
+ {
+ stream.RefFrames = streamInfo.refs;
+ }
}
else
{
@@ -927,25 +932,26 @@ namespace MediaBrowser.MediaEncoding.Probing
private void UpdateFromMediaInfo(MediaSourceInfo video, MediaStream videoStream)
{
- if (video.Protocol == MediaProtocol.File)
+ if (video.Protocol == MediaProtocol.File && videoStream != null)
{
- if (videoStream != null)
+ try
{
- try
- {
- _logger.Debug("Running MediaInfo against {0}", video.Path);
+ _logger.Debug("Running MediaInfo against {0}", video.Path);
- var result = new MediaInfoLib().GetVideoInfo(video.Path);
+ var result = new MediaInfoLib().GetVideoInfo(video.Path);
- videoStream.IsCabac = result.IsCabac ?? videoStream.IsCabac;
- videoStream.IsInterlaced = result.IsInterlaced ?? videoStream.IsInterlaced;
- videoStream.BitDepth = result.BitDepth ?? videoStream.BitDepth;
- videoStream.RefFrames = result.RefFrames;
- }
- catch (Exception ex)
- {
- _logger.ErrorException("Error running MediaInfo on {0}", ex, video.Path);
- }
+ videoStream.IsCabac = result.IsCabac ?? videoStream.IsCabac;
+ videoStream.IsInterlaced = result.IsInterlaced ?? videoStream.IsInterlaced;
+ videoStream.BitDepth = result.BitDepth ?? videoStream.BitDepth;
+ videoStream.RefFrames = result.RefFrames ?? videoStream.RefFrames;
+ }
+ catch (TypeLoadException)
+ {
+ // This is non-essential. Don't spam the log
+ }
+ catch (Exception ex)
+ {
+ _logger.ErrorException("Error running MediaInfo on {0}", ex, video.Path);
}
}
}