diff options
| author | Carl Hetherington <cth@carlh.net> | 2025-12-12 11:43:45 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2025-12-15 00:20:53 +0100 |
| commit | 52b3eee4e7285e26469b2a5f4d9d9eac20aba387 (patch) | |
| tree | f3741553ff125d7b47a2893e1cc2904606286dfa /test | |
| parent | 27ba3d15cc2bc70f926b6ee8c43662a968faa29b (diff) | |
Fix error when seeking a file with no video and >1 audio stream (#3128).
Diffstat (limited to 'test')
| m--------- | test/data | 0 | ||||
| -rw-r--r-- | test/ffmpeg_decoder_seek_test.cc | 22 |
2 files changed, 22 insertions, 0 deletions
diff --git a/test/data b/test/data -Subproject 7bc927ee1c828ce5f6f8e376176c8a44f193ed1 +Subproject 090abdff0d1f62f363792a13982d836f891b390 diff --git a/test/ffmpeg_decoder_seek_test.cc b/test/ffmpeg_decoder_seek_test.cc index ee0da99da..a3212318c 100644 --- a/test/ffmpeg_decoder_seek_test.cc +++ b/test/ffmpeg_decoder_seek_test.cc @@ -28,6 +28,8 @@ */ +#include "lib/audio_decoder.h" +#include "lib/content_audio.h" #include "lib/content_video.h" #include "lib/ffmpeg_content.h" #include "lib/ffmpeg_decoder.h" @@ -152,3 +154,23 @@ BOOST_AUTO_TEST_CASE(seek_when_backward_fails) } } + +BOOST_AUTO_TEST_CASE(seek_with_no_video_two_audio) +{ + auto content = make_shared<FFmpegContent>("test/data/no_video_two_audio.mov"); + auto film = new_test_film("seek_with_no_video_two_audio", { content }); + auto decoder = make_shared<FFmpegDecoder>(film, content, false); + + optional<Frame> frame; + auto audio = [&](AudioStreamPtr, ContentAudio audio) { + frame = audio.frame; + }; + + decoder->audio->Data.connect(boost::bind<void>(audio, _1, _2)); + decoder->seek(dcpomatic::ContentTime::from_seconds(1), false); + while (!decoder->pass() && frame == boost::none) {} + + BOOST_REQUIRE(frame != boost::none); + BOOST_CHECK(*frame > 0); +} + |
