fix merge conflict

This commit is contained in:
Luke Pulverenti
2015-12-19 10:56:07 -05:00
parent ca52e8c23b
commit 5963affec5
8 changed files with 11 additions and 483 deletions

View File

@@ -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>

View File

@@ -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);
return;
}
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 ?? 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;
}
}
}