From: Eugen Rochko Date: Sat, 29 Aug 2020 23:54:30 +0000 (+0200) Subject: Fix videos with near-60 fps being rejected (#14684) X-Git-Url: https://git.xn--scling-oua.cat.family/?a=commitdiff_plain;h=bf477cee9f31036ebf3d164ddec1cebef5375513;p=mastodon.git Fix videos with near-60 fps being rejected (#14684) Fix #14668 --- diff --git a/app/models/media_attachment.rb b/app/models/media_attachment.rb index 3d93ec75b..663bb0896 100644 --- a/app/models/media_attachment.rb +++ b/app/models/media_attachment.rb @@ -338,7 +338,7 @@ class MediaAttachment < ApplicationRecord raise Mastodon::StreamValidationError, 'Video has no video stream' if movie.width.nil? || movie.frame_rate.nil? raise Mastodon::DimensionsValidationError, "#{movie.width}x#{movie.height} videos are not supported" if movie.width * movie.height > MAX_VIDEO_MATRIX_LIMIT - raise Mastodon::DimensionsValidationError, "#{movie.frame_rate.to_i}fps videos are not supported" if movie.frame_rate > MAX_VIDEO_FRAME_RATE + raise Mastodon::DimensionsValidationError, "#{movie.frame_rate.floor}fps videos are not supported" if movie.frame_rate.floor > MAX_VIDEO_FRAME_RATE end def set_meta