summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/ffmpeg_content.cc23
-rw-r--r--src/lib/ffmpeg_content.h5
-rw-r--r--src/lib/ffmpeg_stream.h4
3 files changed, 32 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++);
+ }
+ }
+}
+
diff --git a/src/lib/ffmpeg_content.h b/src/lib/ffmpeg_content.h
index c5cf1bdf5..975569ba6 100644
--- a/src/lib/ffmpeg_content.h
+++ b/src/lib/ffmpeg_content.h
@@ -113,6 +113,11 @@ public:
void signal_subtitle_stream_changed();
+ /** Remove all IDs from any streams we have. This is only for working around changes
+ * to stream identification in 2.18.26.
+ */
+ void remove_stream_ids();
+
private:
void add_properties(std::shared_ptr<const Film> film, std::list<UserProperty> &) const override;
diff --git a/src/lib/ffmpeg_stream.h b/src/lib/ffmpeg_stream.h
index 1583e5221..8bdb5e1a4 100644
--- a/src/lib/ffmpeg_stream.h
+++ b/src/lib/ffmpeg_stream.h
@@ -58,6 +58,10 @@ public:
_id = boost::none;
}
+ void set_index(int index) {
+ _index = index;
+ }
+
int index(AVFormatContext const * c) const;
std::string name;