The Free Software Media System - Server Backend & API
detect anamorphic video
Luke Pulverenti3b30a2aee09b
diff --git a/MediaBrowser.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.csindex 9fd233d8f9..b6e77188be 100644--- a/MediaBrowser.Api/Playback/BaseStreamingService.cs+++ b/MediaBrowser.Api/Playback/BaseStreamingService.cs@@ -1788,7 +1788,8 @@ namespace MediaBrowser.Api.Playbackstate.TargetVideoLevel,state.TargetFramerate,state.TargetPacketLength,- state.TargetTimestamp);+ state.TargetTimestamp,+ state.IsTargetAnamorphic);if (mediaProfile != null){@@ -1885,7 +1886,8 @@ namespace MediaBrowser.Api.Playbackstate.TargetVideoLevel,state.TargetFramerate,state.TargetPacketLength,- state.TranscodeSeekInfo+ state.TranscodeSeekInfo,+ state.IsTargetAnamorphic);}diff --git a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.csindex 8ade680283..aa39b8c9d8 100644--- a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs+++ b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs@@ -313,7 +313,7 @@ namespace MediaBrowser.Api.Playback.Hls// See if we can save come cpu cycles by avoiding encodingif (codec.Equals("copy", StringComparison.OrdinalIgnoreCase)){- return IsH264(state.VideoStream) ? "-codec:v:0 copy -bsf h264_mp4toannexb" : "-codec:v:0 copy";+ return IsH264(state.VideoStream) ? "-codec:v:0 copy -bsf h264_mp4toannexb -bsf dump_extra" : "-codec:v:0 copy";}var keyFrameArg = state.ReadInputAtNativeFramerate ?diff --git a/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs b/MediaBrowser.Api/Playback/Hls/VideoHlsService.csindex 17683c2674..e5b9d09857 100644--- a/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs+++ b/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs@@ -160,7 +160,7 @@ namespace MediaBrowser.Api.Playback.Hls// See if we can save come cpu cycles by avoiding encodingif (codec.Equals("copy", StringComparison.OrdinalIgnoreCase)){- return IsH264(state.VideoStream) ? "-codec:v:0 copy -bsf h264_mp4toannexb" : "-codec:v:0 copy";+ return IsH264(state.VideoStream) ? "-codec:v:0 copy -bsf h264_mp4toannexb -bsf dump_extra" : "-codec:v:0 copy";}var keyFrameArg = state.ReadInputAtNativeFramerate ?diff --git a/MediaBrowser.Api/Playback/Progressive/VideoService.cs b/MediaBrowser.Api/Playback/Progressive/VideoService.csindex bad592e319..11ae21e647 100644--- a/MediaBrowser.Api/Playback/Progressive/VideoService.cs+++ b/MediaBrowser.Api/Playback/Progressive/VideoService.cs@@ -140,7 +140,7 @@ namespace MediaBrowser.Api.Playback.Progressive// See if we can save come cpu cycles by avoiding encodingif (codec.Equals("copy", StringComparison.OrdinalIgnoreCase)){- return state.VideoStream != null && IsH264(state.VideoStream) ? args + " -bsf h264_mp4toannexb" : args;+ return state.VideoStream != null && IsH264(state.VideoStream) ? args + " -bsf h264_mp4toannexb -bsf dump_extra" : args;}const string keyFrameArg = " -force_key_frames expr:if(isnan(prev_forced_t),gte(t,.1),gte(t,prev_forced_t+5))";diff --git a/MediaBrowser.Api/Playback/StreamState.cs b/MediaBrowser.Api/Playback/StreamState.csindex 8a9de6edc2..cf3b63efb5 100644--- a/MediaBrowser.Api/Playback/StreamState.cs+++ b/MediaBrowser.Api/Playback/StreamState.cs@@ -2,7 +2,6 @@using MediaBrowser.Controller.LiveTv;using MediaBrowser.Model.Dlna;using MediaBrowser.Model.Drawing;-using MediaBrowser.Model.Dto;using MediaBrowser.Model.Entities;using MediaBrowser.Model.IO;using MediaBrowser.Model.Logging;@@ -330,5 +329,17 @@ namespace MediaBrowser.Api.Playback}}+ public bool? IsTargetAnamorphic+ {+ get+ {+ if (Request.Static)+ {+ return VideoStream == null ? null : VideoStream.IsAnamorphic;+ }++ return false;+ }+ }}}diff --git a/MediaBrowser.Controller/MediaEncoding/MediaEncoderHelpers.cs b/MediaBrowser.Controller/MediaEncoding/MediaEncoderHelpers.csindex 37dd06da90..17ab0f31c7 100644--- a/MediaBrowser.Controller/MediaEncoding/MediaEncoderHelpers.cs+++ b/MediaBrowser.Controller/MediaEncoding/MediaEncoderHelpers.cs@@ -126,6 +126,9 @@ namespace MediaBrowser.Controller.MediaEncodingstream.RealFrameRate = GetFrameRate(streamInfo.r_frame_rate);stream.BitDepth = GetBitDepth(stream.PixelFormat);++ stream.IsAnamorphic = string.Equals(streamInfo.sample_aspect_ratio, "0:1",+ StringComparison.OrdinalIgnoreCase);}else{diff --git a/MediaBrowser.Dlna/ConnectionManager/ControlHandler.cs b/MediaBrowser.Dlna/ConnectionManager/ControlHandler.csindex d41b4a5bf3..958d71a2b6 100644--- a/MediaBrowser.Dlna/ConnectionManager/ControlHandler.cs+++ b/MediaBrowser.Dlna/ConnectionManager/ControlHandler.cs@@ -6,13 +6,11 @@ using MediaBrowser.Model.Dlna;using MediaBrowser.Model.Logging;using System;using System.Collections.Generic;-using System.Globalization;namespace MediaBrowser.Dlna.ConnectionManager{public class ControlHandler : BaseControlHandler{- private readonly CultureInfo _usCulture = new CultureInfo("en-US");private readonly DeviceProfile _profile;public ControlHandler(ILogger logger, DeviceProfile profile, IServerConfigurationManager config)diff --git a/MediaBrowser.Dlna/Didl/DidlBuilder.cs b/MediaBrowser.Dlna/Didl/DidlBuilder.csindex a8f7c2e7e5..ecaeb63991 100644--- a/MediaBrowser.Dlna/Didl/DidlBuilder.cs+++ b/MediaBrowser.Dlna/Didl/DidlBuilder.cs@@ -179,7 +179,8 @@ namespace MediaBrowser.Dlna.DidlstreamInfo.TargetVideoLevel,streamInfo.TargetFramerate,streamInfo.TargetPacketLength,- streamInfo.TargetTimestamp);+ streamInfo.TargetTimestamp,+ streamInfo.IsTargetAnamorphic);var filename = url.Substring(0, url.IndexOf('?'));@@ -203,7 +204,8 @@ namespace MediaBrowser.Dlna.DidlstreamInfo.TargetVideoLevel,streamInfo.TargetFramerate,streamInfo.TargetPacketLength,- streamInfo.TranscodeSeekInfo);+ streamInfo.TranscodeSeekInfo,+ streamInfo.IsTargetAnamorphic);res.SetAttribute("protocolInfo", String.Format("http-get:*:{0}:{1}",diff --git a/MediaBrowser.Dlna/PlayTo/PlayToController.cs b/MediaBrowser.Dlna/PlayTo/PlayToController.csindex ccf12dc33b..e8e681cb75 100644--- a/MediaBrowser.Dlna/PlayTo/PlayToController.cs+++ b/MediaBrowser.Dlna/PlayTo/PlayToController.cs@@ -514,7 +514,8 @@ namespace MediaBrowser.Dlna.PlayTostreamInfo.TargetVideoLevel,streamInfo.TargetFramerate,streamInfo.TargetPacketLength,- streamInfo.TranscodeSeekInfo);+ streamInfo.TranscodeSeekInfo,+ streamInfo.IsTargetAnamorphic);}return null;diff --git a/MediaBrowser.Dlna/Profiles/WdtvLiveProfile.cs b/MediaBrowser.Dlna/Profiles/WdtvLiveProfile.csindex 4c9ee84fe4..992692b034 100644--- a/MediaBrowser.Dlna/Profiles/WdtvLiveProfile.cs+++ b/MediaBrowser.Dlna/Profiles/WdtvLiveProfile.cs@@ -83,7 +83,7 @@ namespace MediaBrowser.Dlna.ProfilesContainer = "ts",Type = DlnaProfileType.Video,VideoCodec = "mpeg1video,mpeg2video,h264,vc1",- AudioCodec = "ac3,dca,mp2,mp3"+ AudioCodec = "ac3,dca,mp2,mp3,aac"},new DirectPlayProfilediff --git a/MediaBrowser.Dlna/Profiles/WindowsPhoneProfile.cs b/MediaBrowser.Dlna/Profiles/WindowsPhoneProfile.csindex 80cc8ad719..66949c5330 100644--- a/MediaBrowser.Dlna/Profiles/WindowsPhoneProfile.cs+++ b/MediaBrowser.Dlna/Profiles/WindowsPhoneProfile.cs@@ -93,6 +93,20 @@ namespace MediaBrowser.Dlna.ProfilesCodecProfiles = new[]{+ new CodecProfile+ {+ Type = CodecType.Video,+ Conditions = new []+ {+ new ProfileCondition+ {+ Condition = ProfileConditionType.NotEquals,+ Property = ProfileConditionValue.IsAnamorphic,+ Value = "true"+ }+ }+ },+new CodecProfile{Type = CodecType.Video,diff --git a/MediaBrowser.Dlna/Profiles/Xml/WDTV Live.xml b/MediaBrowser.Dlna/Profiles/Xml/WDTV Live.xmlindex 84d5885c64..5f57fa9ed2 100644--- a/MediaBrowser.Dlna/Profiles/Xml/WDTV Live.xml+++ b/MediaBrowser.Dlna/Profiles/Xml/WDTV Live.xml@@ -34,7 +34,7 @@<DirectPlayProfile container="avi" audioCodec="ac3,dca,mp2,mp3,pcm" videoCodec="mpeg1video,mpeg2video,mpeg4,h264,vc1" type="Video" /><DirectPlayProfile container="mpeg" audioCodec="ac3,dca,mp2,mp3,pcm" videoCodec="mpeg1video,mpeg2video" type="Video" /><DirectPlayProfile container="mkv" audioCodec="ac3,dca,aac,mp2,mp3,pcm" videoCodec="mpeg1video,mpeg2video,mpeg4,h264,vc1" type="Video" />- <DirectPlayProfile container="ts" audioCodec="ac3,dca,mp2,mp3" videoCodec="mpeg1video,mpeg2video,h264,vc1" type="Video" />+ <DirectPlayProfile container="ts" audioCodec="ac3,dca,mp2,mp3,aac" videoCodec="mpeg1video,mpeg2video,h264,vc1" type="Video" /><DirectPlayProfile container="mp4,mov" audioCodec="ac3,aac,mp2,mp3" videoCodec="h264,mpeg4" type="Video" /><DirectPlayProfile container="asf" audioCodec="wmav2,wmapro" videoCodec="vc1" type="Video" /><DirectPlayProfile container="asf" audioCodec="mp2,ac3" videoCodec="mpeg2video" type="Video" />diff --git a/MediaBrowser.Dlna/Service/BaseControlHandler.cs b/MediaBrowser.Dlna/Service/BaseControlHandler.csindex 2d5f4edb3a..9f7e87088a 100644--- a/MediaBrowser.Dlna/Service/BaseControlHandler.cs+++ b/MediaBrowser.Dlna/Service/BaseControlHandler.cs@@ -92,7 +92,9 @@ namespace MediaBrowser.Dlna.ServiceXml = xml,IsSuccessful = true};- Logger.Debug(xml);++ //Logger.Debug(xml);+controlResponse.Headers.Add("EXT", string.Empty);return controlResponse;diff --git a/MediaBrowser.Model/Dlna/ConditionProcessor.cs b/MediaBrowser.Model/Dlna/ConditionProcessor.csindex 64ce2aabac..61428e39b1 100644--- a/MediaBrowser.Model/Dlna/ConditionProcessor.cs+++ b/MediaBrowser.Model/Dlna/ConditionProcessor.cs@@ -17,7 +17,8 @@ namespace MediaBrowser.Model.Dlnadouble? videoLevel,double? videoFramerate,int? packetLength,- TransportStreamTimestamp? timestamp)+ TransportStreamTimestamp? timestamp,+ bool? isAnamorphic){switch (condition.Property){@@ -27,6 +28,8 @@ namespace MediaBrowser.Model.Dlnacase ProfileConditionValue.Has64BitOffsets:// TODO: Implementreturn true;+ case ProfileConditionValue.IsAnamorphic:+ return IsConditionSatisfied(condition, isAnamorphic);case ProfileConditionValue.VideoFramerate:return IsConditionSatisfied(condition, videoFramerate);case ProfileConditionValue.VideoLevel:@@ -147,6 +150,31 @@ namespace MediaBrowser.Model.Dlnathrow new InvalidOperationException("Unexpected ProfileConditionType");}}++ private bool IsConditionSatisfied(ProfileCondition condition, bool? currentValue)+ {+ if (!currentValue.HasValue)+ {+ // If the value is unknown, it satisfies if not marked as required+ return !condition.IsRequired;+ }++ bool expected;+ if (BoolHelper.TryParseCultureInvariant(condition.Value, out expected))+ {+ switch (condition.Condition)+ {+ case ProfileConditionType.Equals:+ return currentValue.Value == expected;+ case ProfileConditionType.NotEquals:+ return currentValue.Value != expected;+ default:+ throw new InvalidOperationException("Unexpected ProfileConditionType");+ }+ }++ return false;+ }private bool IsConditionSatisfied(ProfileCondition condition, double? currentValue){diff --git a/MediaBrowser.Model/Dlna/ContentFeatureBuilder.cs b/MediaBrowser.Model/Dlna/ContentFeatureBuilder.csindex c97c06d34a..55418e13b1 100644--- a/MediaBrowser.Model/Dlna/ContentFeatureBuilder.cs+++ b/MediaBrowser.Model/Dlna/ContentFeatureBuilder.cs@@ -108,7 +108,8 @@ namespace MediaBrowser.Model.Dlnadouble? videoLevel,double? videoFramerate,int? packetLength,- TranscodeSeekInfo transcodeSeekInfo)+ TranscodeSeekInfo transcodeSeekInfo,+ bool? isAnamorphic){// first bit means Time based seek supported, second byte range seek supported (not sure about the order now), so 01 = only byte seek, 10 = time based, 11 = both, 00 = nonestring orgOp = ";DLNA.ORG_OP=" + DlnaMaps.GetOrgOpValue(runtimeTicks.HasValue, isDirectStream, transcodeSeekInfo);@@ -145,7 +146,8 @@ namespace MediaBrowser.Model.DlnavideoLevel,videoFramerate,packetLength,- timestamp);+ timestamp,+ isAnamorphic);string orgPn = mediaProfile == null ? null : mediaProfile.OrgPn;diff --git a/MediaBrowser.Model/Dlna/DeviceProfile.cs b/MediaBrowser.Model/Dlna/DeviceProfile.csindex 3cb3b383eb..fb670a5de1 100644--- a/MediaBrowser.Model/Dlna/DeviceProfile.cs+++ b/MediaBrowser.Model/Dlna/DeviceProfile.cs@@ -269,7 +269,8 @@ namespace MediaBrowser.Model.Dlnadouble? videoLevel,double? videoFramerate,int? packetLength,- TransportStreamTimestamp timestamp)+ TransportStreamTimestamp timestamp,+ bool? isAnamorphic){container = (container ?? string.Empty).TrimStart('.');@@ -303,7 +304,7 @@ namespace MediaBrowser.Model.Dlnavar anyOff = false;foreach (ProfileCondition c in i.Conditions){- if (!conditionProcessor.IsVideoConditionSatisfied(c, audioBitrate, audioChannels, width, height, bitDepth, videoBitrate, videoProfile, videoLevel, videoFramerate, packetLength, timestamp))+ if (!conditionProcessor.IsVideoConditionSatisfied(c, audioBitrate, audioChannels, width, height, bitDepth, videoBitrate, videoProfile, videoLevel, videoFramerate, packetLength, timestamp, isAnamorphic)){anyOff = true;break;diff --git a/MediaBrowser.Model/Dlna/ProfileConditionValue.cs b/MediaBrowser.Model/Dlna/ProfileConditionValue.csindex 56a322f5ad..544a011846 100644--- a/MediaBrowser.Model/Dlna/ProfileConditionValue.cs+++ b/MediaBrowser.Model/Dlna/ProfileConditionValue.cs@@ -2,18 +2,19 @@{public enum ProfileConditionValue{- AudioChannels,- AudioBitrate,- AudioProfile,- Width,- Height,- Has64BitOffsets,- PacketLength,- VideoBitDepth,- VideoBitrate,- VideoFramerate,- VideoLevel,- VideoProfile,- VideoTimestamp+ AudioChannels = 0,+ AudioBitrate = 1,+ AudioProfile = 2,+ Width = 3,+ Height = 4,+ Has64BitOffsets = 5,+ PacketLength = 6,+ VideoBitDepth = 7,+ VideoBitrate = 8,+ VideoFramerate = 9,+ VideoLevel = 10,+ VideoProfile = 11,+ VideoTimestamp = 12,+ IsAnamorphic = 13}}\ No newline at end of filediff --git a/MediaBrowser.Model/Dlna/StreamBuilder.cs b/MediaBrowser.Model/Dlna/StreamBuilder.csindex 5828ded99a..5e8ba3ff12 100644--- a/MediaBrowser.Model/Dlna/StreamBuilder.cs+++ b/MediaBrowser.Model/Dlna/StreamBuilder.cs@@ -370,6 +370,7 @@ namespace MediaBrowser.Model.Dlnadouble? videoLevel = videoStream == null ? null : videoStream.Level;string videoProfile = videoStream == null ? null : videoStream.Profile;float? videoFramerate = videoStream == null ? null : videoStream.AverageFrameRate ?? videoStream.AverageFrameRate;+ bool? isAnamorphic = videoStream == null ? null : videoStream.IsAnamorphic;int? audioBitrate = audioStream == null ? null : audioStream.BitRate;int? audioChannels = audioStream == null ? null : audioStream.Channels;@@ -381,7 +382,7 @@ namespace MediaBrowser.Model.Dlna// Check container conditionsforeach (ProfileCondition i in conditions){- if (!conditionProcessor.IsVideoConditionSatisfied(i, audioBitrate, audioChannels, width, height, bitDepth, videoBitrate, videoProfile, videoLevel, videoFramerate, packetLength, timestamp))+ if (!conditionProcessor.IsVideoConditionSatisfied(i, audioBitrate, audioChannels, width, height, bitDepth, videoBitrate, videoProfile, videoLevel, videoFramerate, packetLength, timestamp, isAnamorphic)){return null;}@@ -403,7 +404,7 @@ namespace MediaBrowser.Model.Dlnaforeach (ProfileCondition i in conditions){- if (!conditionProcessor.IsVideoConditionSatisfied(i, audioBitrate, audioChannels, width, height, bitDepth, videoBitrate, videoProfile, videoLevel, videoFramerate, packetLength, timestamp))+ if (!conditionProcessor.IsVideoConditionSatisfied(i, audioBitrate, audioChannels, width, height, bitDepth, videoBitrate, videoProfile, videoLevel, videoFramerate, packetLength, timestamp, isAnamorphic)){return null;}@@ -520,6 +521,7 @@ namespace MediaBrowser.Model.Dlnabreak;}case ProfileConditionValue.AudioProfile:+ case ProfileConditionValue.IsAnamorphic:case ProfileConditionValue.Has64BitOffsets:case ProfileConditionValue.PacketLength:case ProfileConditionValue.VideoTimestamp:diff --git a/MediaBrowser.Model/Dlna/StreamInfo.cs b/MediaBrowser.Model/Dlna/StreamInfo.csindex b5aded6842..9d23597fae 100644--- a/MediaBrowser.Model/Dlna/StreamInfo.cs+++ b/MediaBrowser.Model/Dlna/StreamInfo.cs@@ -348,6 +348,19 @@ namespace MediaBrowser.Model.Dlna}}+ public bool? IsTargetAnamorphic+ {+ get+ {+ if (IsDirectStream)+ {+ return TargetVideoStream == null ? null : TargetVideoStream.IsAnamorphic;+ }++ return false;+ }+ }+public int? TargetWidth{getdiff --git a/MediaBrowser.Model/Entities/MediaStream.cs b/MediaBrowser.Model/Entities/MediaStream.csindex 8380958329..7be8a64b74 100644--- a/MediaBrowser.Model/Entities/MediaStream.cs+++ b/MediaBrowser.Model/Entities/MediaStream.cs@@ -33,7 +33,7 @@ namespace MediaBrowser.Model.Entities/// </summary>/// <value>The channel layout.</value>public string ChannelLayout { get; set; }-+/// <summary>/// Gets or sets the bit rate./// </summary>@@ -155,11 +155,17 @@ namespace MediaBrowser.Model.Entities/// </summary>/// <value>The pixel format.</value>public string PixelFormat { get; set; }-+/// <summary>/// Gets or sets the level./// </summary>/// <value>The level.</value>public double? Level { get; set; }++ /// <summary>+ /// Gets a value indicating whether this instance is anamorphic.+ /// </summary>+ /// <value><c>true</c> if this instance is anamorphic; otherwise, <c>false</c>.</value>+ public bool? IsAnamorphic { get; set; }}}diff --git a/MediaBrowser.Model/Extensions/DoubleHelper.cs b/MediaBrowser.Model/Extensions/DoubleHelper.csindex bcaf2d7800..00e3bc6245 100644--- a/MediaBrowser.Model/Extensions/DoubleHelper.cs+++ b/MediaBrowser.Model/Extensions/DoubleHelper.cs@@ -18,4 +18,18 @@ namespace MediaBrowser.Model.Extensionsreturn double.TryParse(s, NumberStyles.Any, CultureInfo.InvariantCulture, out result);}}++ public static class BoolHelper+ {+ /// <summary>+ /// Tries the parse culture invariant.+ /// </summary>+ /// <param name="s">The s.</param>+ /// <param name="result">The result.</param>+ /// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>+ public static bool TryParseCultureInvariant(string s, out bool result)+ {+ return bool.TryParse(s, out result);+ }+ }}diff --git a/MediaBrowser.Server.Implementations/Library/CoreResolutionIgnoreRule.cs b/MediaBrowser.Server.Implementations/Library/CoreResolutionIgnoreRule.csindex c830c13b86..17118f4b4e 100644--- a/MediaBrowser.Server.Implementations/Library/CoreResolutionIgnoreRule.cs+++ b/MediaBrowser.Server.Implementations/Library/CoreResolutionIgnoreRule.cs@@ -116,6 +116,12 @@ namespace MediaBrowser.Server.Implementations.Libraryreturn true;}}++ // Ignore samples+ if (filename.IndexOf(".sample.", StringComparison.OrdinalIgnoreCase) != -1)+ {+ return true;+ }}return false;diff --git a/MediaBrowser.Server.Implementations/Persistence/SqliteMediaStreamsRepository.cs b/MediaBrowser.Server.Implementations/Persistence/SqliteMediaStreamsRepository.csindex 58ca432bbd..1e7d9fe823 100644--- a/MediaBrowser.Server.Implementations/Persistence/SqliteMediaStreamsRepository.cs+++ b/MediaBrowser.Server.Implementations/Persistence/SqliteMediaStreamsRepository.cs@@ -58,6 +58,7 @@ namespace MediaBrowser.Server.Implementations.PersistenceAddPixelFormatColumnCommand();AddBitDepthCommand();+ AddIsAnamorphicColumn();PrepareStatements();@@ -126,6 +127,37 @@ namespace MediaBrowser.Server.Implementations.Persistence_connection.RunQueries(new[] { builder.ToString() }, _logger);}+ private void AddIsAnamorphicColumn()+ {+ using (var cmd = _connection.CreateCommand())+ {+ cmd.CommandText = "PRAGMA table_info(mediastreams)";++ using (var reader = cmd.ExecuteReader(CommandBehavior.SequentialAccess | CommandBehavior.SingleResult))+ {+ while (reader.Read())+ {+ if (!reader.IsDBNull(1))+ {+ var name = reader.GetString(1);++ if (string.Equals(name, "IsAnamorphic", StringComparison.OrdinalIgnoreCase))+ {+ return;+ }+ }+ }+ }+ }++ var builder = new StringBuilder();++ builder.AppendLine("alter table mediastreams");+ builder.AppendLine("add column IsAnamorphic BIT NULL");++ _connection.RunQueries(new[] { builder.ToString() }, _logger);+ }+private readonly string[] _saveColumns ={"ItemId",@@ -150,7 +182,8 @@ namespace MediaBrowser.Server.Implementations.Persistence"RealFrameRate","Level","PixelFormat",- "BitDepth"+ "BitDepth",+ "IsAnamorphic"};/// <summary>@@ -319,6 +352,11 @@ namespace MediaBrowser.Server.Implementations.Persistenceitem.BitDepth = reader.GetInt32(22);}+ if (!reader.IsDBNull(23))+ {+ item.IsAnamorphic = reader.GetBoolean(23);+ }+return item;}@@ -382,6 +420,7 @@ namespace MediaBrowser.Server.Implementations.Persistence_saveStreamCommand.GetParameter(20).Value = stream.Level;_saveStreamCommand.GetParameter(21).Value = stream.PixelFormat;_saveStreamCommand.GetParameter(22).Value = stream.BitDepth;+ _saveStreamCommand.GetParameter(23).Value = stream.IsAnamorphic;_saveStreamCommand.Transaction = transaction;_saveStreamCommand.ExecuteNonQuery();