浏览代码

add support for input audio/video sync

Luke Pulverenti 11 年之前
父节点
当前提交
6ef5758713
共有 2 个文件被更改,包括 13 次插入0 次删除
  1. 10 0
      MediaBrowser.Api/Playback/BaseStreamingService.cs
  2. 3 0
      MediaBrowser.Api/Playback/StreamState.cs

+ 10 - 0
MediaBrowser.Api/Playback/BaseStreamingService.cs

@@ -1503,6 +1503,16 @@ namespace MediaBrowser.Api.Playback
                 inputModifier += " -acodec " + state.InputAudioCodec;
                 inputModifier += " -acodec " + state.InputAudioCodec;
             }
             }
 
 
+            if (!string.IsNullOrEmpty(state.InputAudioSync))
+            {
+                inputModifier += " -async " + state.InputAudioSync;
+            }
+
+            if (!string.IsNullOrEmpty(state.InputVideoSync))
+            {
+                inputModifier += " -vsync " + state.InputVideoSync;
+            }
+
             if (state.ReadInputAtNativeFramerate)
             if (state.ReadInputAtNativeFramerate)
             {
             {
                 inputModifier += " -re";
                 inputModifier += " -re";

+ 3 - 0
MediaBrowser.Api/Playback/StreamState.cs

@@ -64,6 +64,9 @@ namespace MediaBrowser.Api.Playback
         public string AudioSync = "1";
         public string AudioSync = "1";
         public string VideoSync = "vfr";
         public string VideoSync = "vfr";
 
 
+        public string InputAudioSync { get; set; }
+        public string InputVideoSync { get; set; }
+ 
         public bool DeInterlace { get; set; }
         public bool DeInterlace { get; set; }
 
 
         public bool ReadInputAtNativeFramerate { get; set; }
         public bool ReadInputAtNativeFramerate { get; set; }