projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Prevent erroneous creation of subtitle MXF where there are no subtitles.
[dcpomatic.git]
/
src
/
lib
/
video_content.cc
diff --git
a/src/lib/video_content.cc
b/src/lib/video_content.cc
index 05f5c538eee2a81c6344f603ab2bfa3e60dfd2cb..a2a4e6c6b3b46c452290975d5eccb2952fbaab89 100644
(file)
--- a/
src/lib/video_content.cc
+++ b/
src/lib/video_content.cc
@@
-31,9
+31,12
@@
#include "film.h"
#include "exceptions.h"
#include "frame_rate_change.h"
#include "film.h"
#include "exceptions.h"
#include "frame_rate_change.h"
+#include "log.h"
#include "i18n.h"
#include "i18n.h"
+#define LOG_GENERAL(...) film->log()->log (String::compose (__VA_ARGS__), Log::TYPE_GENERAL);
+
int const VideoContentProperty::VIDEO_SIZE = 0;
int const VideoContentProperty::VIDEO_FRAME_RATE = 1;
int const VideoContentProperty::VIDEO_FRAME_TYPE = 2;
int const VideoContentProperty::VIDEO_SIZE = 0;
int const VideoContentProperty::VIDEO_FRAME_RATE = 1;
int const VideoContentProperty::VIDEO_FRAME_TYPE = 2;
@@
-96,7
+99,7
@@
VideoContent::VideoContent (shared_ptr<const Film> f, cxml::ConstNodePtr node, i
/* DCP-o-matic 1.0 branch */
_video_length = ContentTime::from_frames (node->number_child<int64_t> ("VideoLength"), _video_frame_rate);
} else {
/* DCP-o-matic 1.0 branch */
_video_length = ContentTime::from_frames (node->number_child<int64_t> ("VideoLength"), _video_frame_rate);
} else {
- _video_length = ContentTime (node->number_child<
int64_t
> ("VideoLength"));
+ _video_length = ContentTime (node->number_child<
ContentTime::Type
> ("VideoLength"));
}
_video_frame_type = static_cast<VideoFrameType> (node->number_child<int> ("VideoFrameType"));
}
_video_frame_type = static_cast<VideoFrameType> (node->number_child<int> ("VideoFrameType"));
@@
-188,15
+191,22
@@
VideoContent::take_from_video_examiner (shared_ptr<VideoExaminer> d)
/* These examiner calls could call other content methods which take a lock on the mutex */
dcp::Size const vs = d->video_size ();
float const vfr = d->video_frame_rate ();
/* These examiner calls could call other content methods which take a lock on the mutex */
dcp::Size const vs = d->video_size ();
float const vfr = d->video_frame_rate ();
+ ContentTime vl = d->video_length ();
{
boost::mutex::scoped_lock lm (_mutex);
_video_size = vs;
_video_frame_rate = vfr;
{
boost::mutex::scoped_lock lm (_mutex);
_video_size = vs;
_video_frame_rate = vfr;
+ _video_length = vl;
}
}
+
+ 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));
signal_changed (VideoContentProperty::VIDEO_SIZE);
signal_changed (VideoContentProperty::VIDEO_FRAME_RATE);
signal_changed (VideoContentProperty::VIDEO_SIZE);
signal_changed (VideoContentProperty::VIDEO_FRAME_RATE);
+ signal_changed (ContentProperty::LENGTH);
}
}
@@
-408,6
+418,21
@@
VideoContent::scale_and_crop_to_fit_height ()
set_right_crop (crop / 2);
}
set_right_crop (crop / 2);
}
+void
+VideoContent::set_video_frame_rate (float r)
+{
+ {
+ boost::mutex::scoped_lock lm (_mutex);
+ if (_video_frame_rate == r) {
+ return;
+ }
+
+ _video_frame_rate = r;
+ }
+
+ signal_changed (VideoContentProperty::VIDEO_FRAME_RATE);
+}
+
VideoContentScale::VideoContentScale (Ratio const * r)
: _ratio (r)
, _scale (true)
VideoContentScale::VideoContentScale (Ratio const * r)
: _ratio (r)
, _scale (true)