diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2015-12-19 10:56:07 -0500 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2015-12-19 10:56:07 -0500 |
| commit | 5963affec5b492d4859017cfd9352dfd683b3795 (patch) | |
| tree | 8f867d1464d27f3324e45858736bfdedada41875 /MediaBrowser.MediaEncoding | |
| parent | ca52e8c23b806a004471da86e8d41de8f5392fc7 (diff) | |
fix merge conflict
Diffstat (limited to 'MediaBrowser.MediaEncoding')
| -rw-r--r-- | MediaBrowser.MediaEncoding/MediaBrowser.MediaEncoding.csproj | 4 | ||||
| -rw-r--r-- | MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs | 34 |
2 files changed, 11 insertions, 27 deletions
diff --git a/MediaBrowser.MediaEncoding/MediaBrowser.MediaEncoding.csproj b/MediaBrowser.MediaEncoding/MediaBrowser.MediaEncoding.csproj index 1f74994e5..df5ab4651 100644 --- a/MediaBrowser.MediaEncoding/MediaBrowser.MediaEncoding.csproj +++ b/MediaBrowser.MediaEncoding/MediaBrowser.MediaEncoding.csproj @@ -99,10 +99,6 @@ <Project>{17e1f4e6-8abd-4fe5-9ecf-43d4b6087ba2}</Project> <Name>MediaBrowser.Controller</Name> </ProjectReference> - <ProjectReference Include="..\MediaBrowser.MediaInfo\MediaBrowser.MediaInfo.csproj"> - <Project>{6e4145e4-c6d4-4e4d-94f2-87188db6e239}</Project> - <Name>MediaBrowser.MediaInfo</Name> - </ProjectReference> <ProjectReference Include="..\MediaBrowser.Model\MediaBrowser.Model.csproj"> <Project>{7eeeb4bb-f3e8-48fc-b4c5-70f0fff8329b}</Project> <Name>MediaBrowser.Model</Name> diff --git a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs index d4df19af2..55b3398bb 100644 --- a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs +++ b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs @@ -1,5 +1,4 @@ using MediaBrowser.Common.IO; -using MediaBrowser.MediaInfo; using MediaBrowser.Model.Dto; using MediaBrowser.Model.Entities; using MediaBrowser.Model.Extensions; @@ -26,7 +25,7 @@ namespace MediaBrowser.MediaEncoding.Probing _fileSystem = fileSystem; } - public Model.MediaInfo.MediaInfo GetMediaInfo(InternalMediaInfoResult data, VideoType videoType, bool isAudio, string path, MediaProtocol protocol) + public MediaInfo GetMediaInfo(InternalMediaInfoResult data, VideoType videoType, bool isAudio, string path, MediaProtocol protocol) { var info = new Model.MediaInfo.MediaInfo { @@ -109,7 +108,7 @@ namespace MediaBrowser.MediaEncoding.Probing if (videoStream != null && videoType == VideoType.VideoFile) { - UpdateFromMediaInfo(info, videoStream); + DetectInterlaced(info, videoStream); } } @@ -934,29 +933,18 @@ namespace MediaBrowser.MediaEncoding.Probing return TransportStreamTimestamp.None; } - private void UpdateFromMediaInfo(MediaSourceInfo video, MediaStream videoStream) + private void DetectInterlaced(MediaSourceInfo video, MediaStream videoStream) { - if (video.Protocol == MediaProtocol.File && videoStream != null) + if (video.Protocol != MediaProtocol.File || videoStream == null) { - try - { - _logger.Debug("Running MediaInfo against {0}", video.Path); - - var result = new MediaInfoLib().GetVideoInfo(video.Path); + return; + } - 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); - } + // Take a shortcut and limit this to containers that are likely to have interlaced content + if (!string.Equals(video.Container, "ts", StringComparison.OrdinalIgnoreCase) && + !string.Equals(video.Container, "wtv", StringComparison.OrdinalIgnoreCase)) + { + return; } } } |
