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 /src | |
| parent | 27ba3d15cc2bc70f926b6ee8c43662a968faa29b (diff) | |
Fix error when seeking a file with no video and >1 audio stream (#3128).
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/ffmpeg_decoder.cc | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/lib/ffmpeg_decoder.cc b/src/lib/ffmpeg_decoder.cc index c70733c4c..ec85bb56c 100644 --- a/src/lib/ffmpeg_decoder.cc +++ b/src/lib/ffmpeg_decoder.cc @@ -418,11 +418,10 @@ FFmpegDecoder::seek (ContentTime time, bool accurate) if (_video_stream) { stream = _video_stream; } else { - DCPOMATIC_ASSERT (_ffmpeg_content->audio); - auto s = dynamic_pointer_cast<FFmpegAudioStream>(_ffmpeg_content->audio->stream()); - if (s) { - stream = s->index (_format_context); - } + DCPOMATIC_ASSERT(_ffmpeg_content->audio); + auto streams = _ffmpeg_content->ffmpeg_audio_streams(); + DCPOMATIC_ASSERT(!streams.empty()); + stream = streams[0]->index(_format_context); } DCPOMATIC_ASSERT (stream); |
