diff options
| author | Carl Hetherington <cth@carlh.net> | 2025-11-04 21:03:15 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2025-11-09 20:15:19 +0100 |
| commit | c49bd081b3b06f9c036b63af6f2ffe05db059134 (patch) | |
| tree | b1de58ac1849eb2348790eeb669efd490e95147f /src/lib/ffmpeg_content.cc | |
| parent | d78820e4b4c9d24bef4c2ddd522900ca11d00fa7 (diff) | |
Add remove_stream_ids().
Diffstat (limited to 'src/lib/ffmpeg_content.cc')
| -rw-r--r-- | src/lib/ffmpeg_content.cc | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/lib/ffmpeg_content.cc b/src/lib/ffmpeg_content.cc index 7e749c656..322553586 100644 --- a/src/lib/ffmpeg_content.cc +++ b/src/lib/ffmpeg_content.cc @@ -724,3 +724,26 @@ FFmpegContent::take_settings_from(shared_ptr<const Content> c) _filters = fc->_filters; } + +void +FFmpegContent::remove_stream_ids() +{ + int index = 0; + + if (audio) { + for (auto stream: audio->streams()) { + if (auto ffmpeg = dynamic_pointer_cast<FFmpegAudioStream>(stream)) { + ffmpeg->unset_id(); + ffmpeg->set_index(index++); + } + } + } + + for (auto stream: _subtitle_streams) { + if (auto ffmpeg = dynamic_pointer_cast<FFmpegSubtitleStream>(stream)) { + ffmpeg->unset_id(); + ffmpeg->set_index(index++); + } + } +} + |
