summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryufushiro <62991447+yufushiro@users.noreply.github.com>2023-08-23 15:44:56 +0900
committerClaire <claire.github-309c@sitedethib.com>2023-09-19 17:01:32 +0200
commitbc4408db08e30e3956a9de7647043532396c6ba0 (patch)
tree32d5da3cbf74c77db1a2f2cee85c2ff7b47dd540
parent9ae857c035c9346c1498ea64e0c4ef7ffc0ca11c (diff)
Fix unexpected audio stream transcoding when uploaded video is eligible to passthrough (#26608)
Co-authored-by: Claire <claire.github-309c@sitedethib.com>
-rw-r--r--lib/paperclip/transcoder.rb14
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/paperclip/transcoder.rb b/lib/paperclip/transcoder.rb
index be40b492410..0f2e30f7d5e 100644
--- a/lib/paperclip/transcoder.rb
+++ b/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