Skip to content

Commit

Permalink
fix: Media#cut kwargs issues with Ruby 2.7
Browse files Browse the repository at this point in the history
  • Loading branch information
bajankristof committed May 2, 2024
1 parent 498bb38 commit 302e58a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/ffmpeg/media.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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

0 comments on commit 302e58a

Please sign in to comment.