From 302e58a66bc776336de6b248592c37d71bb98484 Mon Sep 17 00:00:00 2001 From: bajankristof Date: Thu, 2 May 2024 12:54:06 +0200 Subject: [PATCH] fix: Media#cut kwargs issues with Ruby 2.7 --- lib/ffmpeg/media.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/ffmpeg/media.rb b/lib/ffmpeg/media.rb index fe76026..bf1de5f 100644 --- a/lib/ffmpeg/media.rb +++ b/lib/ffmpeg/media.rb @@ -243,13 +243,13 @@ def transcoder(output_path, options, **kwargs) Transcoder.new(self, output_path, options, **kwargs) end - def transcode(output_path, options = EncodingOptions.new, **kwargs) - transcoder(output_path, options, **kwargs).run { |progress| yield progress if block_given? } + def transcode(output_path, options = EncodingOptions.new, **kwargs, &block) + transcoder(output_path, options, **kwargs).run(&block) end - def screenshot(output_path, options = EncodingOptions.new, **kwargs) + def screenshot(output_path, options = EncodingOptions.new, **kwargs, &block) options = options.merge(screenshot: true) - transcode(output_path, options, **kwargs) { |progress| yield progress if block_given? } + transcode(output_path, options, **kwargs, &block) end def cut(output_path, from, to, options = EncodingOptions.new, **kwargs) @@ -262,7 +262,7 @@ def cut(output_path, from, to, options = EncodingOptions.new, **kwargs) end options = options.merge(seek_time: from) - transcode(output_path, options, **kwargs) + transcoder(output_path, options, **kwargs).run end end end