Put some get/sets in FFmpegAudioStream.
[dcpomatic.git] / src / lib / ffmpeg_content.cc
index da4acb5f86f54cf5cd1e2d6b6339eae0031d243d..0af53d8830a52ab8ca8518b0bae5591be12c6127 100644 (file)
@@ -110,7 +110,7 @@ FFmpegContent::FFmpegContent (shared_ptr<const Film> f, vector<boost::shared_ptr
 
        for (size_t i = 0; i < c.size(); ++i) {
                shared_ptr<FFmpegContent> fc = dynamic_pointer_cast<FFmpegContent> (c[i]);
-               if (fc->subtitle_use() && *(fc->_subtitle_stream.get()) != *(ref->_subtitle_stream.get())) {
+               if (fc->use_subtitles() && *(fc->_subtitle_stream.get()) != *(ref->_subtitle_stream.get())) {
                        throw JoinError (_("Content to be joined must use the same subtitle stream."));
                }
 
@@ -174,7 +174,6 @@ FFmpegContent::examine (shared_ptr<Job> job)
 
        shared_ptr<const Film> film = _film.lock ();
        assert (film);
-       LOG_GENERAL ("Video length obtained from header as %1 frames", video_length.frames (video_frame_rate ()));
 
        {
                boost::mutex::scoped_lock lm (_mutex);
@@ -285,7 +284,7 @@ FFmpegContent::audio_channels () const
                return 0;
        }
 
-       return _audio_stream->channels;
+       return _audio_stream->channels ();
 }
 
 int
@@ -297,7 +296,7 @@ FFmpegContent::audio_frame_rate () const
                return 0;
        }
 
-       return _audio_stream->frame_rate;
+       return _audio_stream->frame_rate ();
 }
 
 bool
@@ -329,7 +328,7 @@ FFmpegContent::audio_mapping () const
                return AudioMapping ();
        }
 
-       return _audio_stream->mapping;
+       return _audio_stream->mapping ();
 }
 
 void
@@ -346,7 +345,7 @@ FFmpegContent::set_filters (vector<Filter const *> const & filters)
 void
 FFmpegContent::set_audio_mapping (AudioMapping m)
 {
-       audio_stream()->mapping = m;
+       audio_stream()->set_mapping (m);
        AudioContent::set_audio_mapping (m);
 }
 
@@ -410,3 +409,9 @@ FFmpegContent::subtitles_during (ContentTimePeriod period, bool starting) const
 
        return d;
 }
+
+bool
+FFmpegContent::has_subtitles () const
+{
+       return !subtitle_streams().empty ();
+}