Quellcode durchsuchen

Fix unexpected audio stream transcoding when uploaded video is eligible to passthrough (#26608)

Co-authored-by: Claire <claire.github-309c@sitedethib.com>
yufushiro vor 9 Monaten
Ursprung
Commit
bc4408db08
1 geänderte Dateien mit 8 neuen und 6 gelöschten Zeilen
  1. 8 6
      lib/paperclip/transcoder.rb

+ 8 - 6
lib/paperclip/transcoder.rb

@@ -37,12 +37,14 @@ module Paperclip
         @output_options['f']       = 'image2'
         @output_options['vframes'] = 1
       when 'mp4'
-        @output_options['acodec'] = 'aac'
-        @output_options['strict'] = 'experimental'
-
-        if high_vfr?(metadata) && !eligible_to_passthrough?(metadata)
-          @output_options['vsync'] = 'vfr'
-          @output_options['r'] = @vfr_threshold
+        unless eligible_to_passthrough?(metadata)
+          @output_options['acodec'] = 'aac'
+          @output_options['strict'] = 'experimental'
+
+          if high_vfr?(metadata)
+            @output_options['vsync'] = 'vfr'
+            @output_options['r'] = @vfr_threshold
+          end
         end
       end