瀏覽代碼

Add a small tolerance value to remux fps check (#12947)

gnattu 7 月之前
父節點
當前提交
954950dc14
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs

+ 4 - 1
MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs

@@ -2196,7 +2196,10 @@ namespace MediaBrowser.Controller.MediaEncoding
             {
                 var videoFrameRate = videoStream.ReferenceFrameRate;
 
-                if (!videoFrameRate.HasValue || videoFrameRate.Value > requestedFramerate.Value)
+                // Add a little tolerance to the framerate check because some videos might record a framerate
+                // that is slightly higher than the intended framerate, but the device can still play it correctly.
+                // 0.05 fps tolerance should be safe enough.
+                if (!videoFrameRate.HasValue || videoFrameRate.Value > requestedFramerate.Value + 0.05f)
                 {
                     return false;
                 }