Merge master.
[dcpomatic.git] / src / lib / ffmpeg_content.cc
index 9b2bfc60649c6b9e58b11905ed3216063e6148df..bb4e022308dc9882dff57d5a0959d0a014cf9cab 100644 (file)
@@ -34,13 +34,13 @@ extern "C" {
 #include "log.h"
 #include "exceptions.h"
 #include "frame_rate_change.h"
+#include "safe_stringstream.h"
 
 #include "i18n.h"
 
 #define LOG_GENERAL(...) film->log()->log (String::compose (__VA_ARGS__), Log::TYPE_GENERAL);
 
 using std::string;
-using std::stringstream;
 using std::vector;
 using std::list;
 using std::cout;
@@ -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."));
                }
 
@@ -235,7 +235,7 @@ FFmpegContent::information () const
                return "";
        }
        
-       stringstream s;
+       SafeStringStream s;
        
        s << String::compose (_("%1 frames; %2 frames per second"), video_length_after_3d_combine().frames (video_frame_rate()), video_frame_rate()) << "\n";
        s << VideoContent::information ();
@@ -284,7 +284,7 @@ FFmpegContent::audio_channels () const
                return 0;
        }
 
-       return _audio_stream->channels;
+       return _audio_stream->channels ();
 }
 
 int
@@ -296,7 +296,7 @@ FFmpegContent::audio_frame_rate () const
                return 0;
        }
 
-       return _audio_stream->frame_rate;
+       return _audio_stream->frame_rate ();
 }
 
 bool
@@ -328,7 +328,7 @@ FFmpegContent::audio_mapping () const
                return AudioMapping ();
        }
 
-       return _audio_stream->mapping;
+       return _audio_stream->mapping ();
 }
 
 void
@@ -345,14 +345,14 @@ 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);
 }
 
 string
 FFmpegContent::identifier () const
 {
-       stringstream s;
+       SafeStringStream s;
 
        s << VideoContent::identifier();