Fix VideoAnalyzerTest with FFmpeg 6.0

FFmpeg 6.0 now reports the duration of `video_without_video_stream.mp4`
as 1.000000 instead of 1.022000.  This discrepancy was [reported][]
to the FFmpeg mailing list, and the [reply][] indicated that the change
is intentional.

For this test, the exact duration isn't significant.  We merely want to
assert that the metadata includes the duration reported by FFmpeg.
Therefore, this commit changes the assertion to accomodate the duration
reported by FFmpeg 6.0 as well as previous versions.

Fixes #49650.

[reported]: https://ffmpeg.org/pipermail/ffmpeg-user/2023-October/057067.html
[reply]: http://ffmpeg.org/pipermail/ffmpeg-user/2023-October/057083.html

Co-authored-by: Yasuo Honda <yasuo.honda@gmail.com>
This commit is contained in:
Jonathan Hefner 2023-10-31 11:47:53 -05:00
parent 2af28a48bb
commit d10c54fe3c
1 changed files with 1 additions and 1 deletions

View File

@ -64,7 +64,7 @@ class ActiveStorage::Analyzer::VideoAnalyzerTest < ActiveSupport::TestCase
assert_not_includes metadata, :width
assert_not_includes metadata, :height
assert_equal 1.022000, metadata[:duration]
assert_includes 1.000000..1.022000, metadata[:duration]
assert_not metadata[:video]
assert metadata[:audio]
end