Merge master.
[dcpomatic.git] / src / lib / ffmpeg_content.cc
index 2b507ab371adf3187c08d5b1241ff80c7f359edc..d3e0fa7b25687010a18cc2797db9aa9a76df3483 100644 (file)
@@ -33,9 +33,12 @@ extern "C" {
 #include "film.h"
 #include "log.h"
 #include "exceptions.h"
+#include "frame_rate_change.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;
@@ -173,7 +176,7 @@ FFmpegContent::examine (shared_ptr<Job> job)
 
        shared_ptr<const Film> film = _film.lock ();
        assert (film);
-       film->log()->log (String::compose ("Video length obtained from header as %1 frames", video_length.frames (video_frame_rate ())));
+       LOG_GENERAL ("Video length obtained from header as %1 frames", video_length.frames (video_frame_rate ()));
 
        {
                boost::mutex::scoped_lock lm (_mutex);
@@ -397,6 +400,9 @@ bool
 FFmpegContent::has_subtitle_during (ContentTimePeriod period) const
 {
        shared_ptr<FFmpegSubtitleStream> stream = subtitle_stream ();
+       if (!stream) {
+               return false;
+       }
 
        /* XXX: inefficient */
        for (vector<ContentTimePeriod>::const_iterator i = stream->periods.begin(); i != stream->periods.end(); ++i) {