summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2016-04-14 03:28:38 +0100
committerCarl Hetherington <cth@carlh.net>2016-05-18 11:50:29 +0100
commit150f708d27b25d5b5d4e486d03c5bc4078027997 (patch)
tree56b65e0d0f11f1f9f469d6069985f5f1a1c3b831 /src/lib
parenta4ad6395a27e8ccb25af3b05f815d318312ae1b7 (diff)
Fix some confusions with FFmpeg audio streams.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/ffmpeg_content.cc22
-rw-r--r--src/lib/ffmpeg_content.h10
2 files changed, 13 insertions, 19 deletions
diff --git a/src/lib/ffmpeg_content.cc b/src/lib/ffmpeg_content.cc
index d9941685d..dfeb2a0ad 100644
--- a/src/lib/ffmpeg_content.cc
+++ b/src/lib/ffmpeg_content.cc
@@ -92,7 +92,7 @@ FFmpegContent::FFmpegContent (shared_ptr<const Film> film, cxml::ConstNodePtr no
audio->add_stream (as);
if (version < 11 && !(*i)->optional_node_child ("Selected")) {
/* This is an old file and this stream is not selected, so un-map it */
- as->set_mapping (AudioMapping (_audio_streams.back()->channels (), MAX_DCP_AUDIO_CHANNELS));
+ as->set_mapping (AudioMapping (as->channels (), MAX_DCP_AUDIO_CHANNELS));
}
}
@@ -393,16 +393,6 @@ FFmpegContent::set_default_colour_conversion ()
}
}
-vector<AudioStreamPtr>
-FFmpegContent::audio_streams () const
-{
- boost::mutex::scoped_lock lm (_mutex);
-
- vector<AudioStreamPtr> s;
- copy (_audio_streams.begin(), _audio_streams.end(), back_inserter (s));
- return s;
-}
-
void
FFmpegContent::add_properties (list<UserProperty>& p) const
{
@@ -540,3 +530,13 @@ FFmpegContent::changed (int property)
subtitle->set_video_frame_rate (video->frame_rate ());
}
}
+
+vector<shared_ptr<FFmpegAudioStream> >
+FFmpegContent::ffmpeg_audio_streams () const
+{
+ vector<shared_ptr<FFmpegAudioStream> > fa;
+ BOOST_FOREACH (AudioStreamPtr i, audio->streams()) {
+ fa.push_back (dynamic_pointer_cast<FFmpegAudioStream> (i));
+ }
+ return fa;
+}
diff --git a/src/lib/ffmpeg_content.h b/src/lib/ffmpeg_content.h
index f39414a61..de222b0de 100644
--- a/src/lib/ffmpeg_content.h
+++ b/src/lib/ffmpeg_content.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2013-2015 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2013-2016 Carl Hetherington <cth@carlh.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -63,8 +63,6 @@ public:
void set_default_colour_conversion ();
- std::vector<AudioStreamPtr> audio_streams () const;
-
bool has_text_subtitles () const;
bool has_image_subtitles () const;
@@ -82,10 +80,7 @@ public:
return _subtitle_stream;
}
- std::vector<boost::shared_ptr<FFmpegAudioStream> > ffmpeg_audio_streams () const {
- boost::mutex::scoped_lock lm (_mutex);
- return _audio_streams;
- }
+ std::vector<boost::shared_ptr<FFmpegAudioStream> > ffmpeg_audio_streams () const;
std::vector<Filter const *> filters () const {
boost::mutex::scoped_lock lm (_mutex);
@@ -112,7 +107,6 @@ private:
std::vector<boost::shared_ptr<FFmpegSubtitleStream> > _subtitle_streams;
boost::shared_ptr<FFmpegSubtitleStream> _subtitle_stream;
- std::vector<boost::shared_ptr<FFmpegAudioStream> > _audio_streams;
boost::optional<ContentTime> _first_video;
/** Video filters that should be used when generating DCPs */
std::vector<Filter const *> _filters;