{
Change (ChangeType::PENDING, PlayerProperty::VIDEO_CONTAINER_SIZE, false);
- {
- boost::mutex::scoped_lock lm (_mutex);
-
- if (s == _video_container_size) {
- lm.unlock ();
- Change (ChangeType::CANCELLED, PlayerProperty::VIDEO_CONTAINER_SIZE, false);
- return;
- }
+ if (s == _video_container_size) {
+ Change(ChangeType::CANCELLED, PlayerProperty::VIDEO_CONTAINER_SIZE, false);
+ return;
+ }
- _video_container_size = s;
+ _video_container_size = s;
+ {
+ boost::mutex::scoped_lock lm (_mutex);
_black_image = make_shared<Image>(AV_PIX_FMT_RGB24, _video_container_size, Image::Alignment::PADDED);
_black_image->make_black ();
}
}
/* i.image will already have been scaled to fit _video_container_size */
- dcp::Size scaled_size (i.rectangle.width * _video_container_size.width, i.rectangle.height * _video_container_size.height);
+ dcp::Size scaled_size (i.rectangle.width * _video_container_size.load().width, i.rectangle.height * _video_container_size.load().height);
captions.push_back (
PositionImage (
i.image,
Position<int> (
- lrint(_video_container_size.width * i.rectangle.x),
- lrint(_video_container_size.height * i.rectangle.y)
+ lrint(_video_container_size.load().width * i.rectangle.x),
+ lrint(_video_container_size.load().height * i.rectangle.y)
)
)
);
auto image = sub.image;
/* We will scale the subtitle up to fit _video_container_size */
- int const width = sub.rectangle.width * _video_container_size.width;
- int const height = sub.rectangle.height * _video_container_size.height;
+ int const width = sub.rectangle.width * _video_container_size.load().width;
+ int const height = sub.rectangle.height * _video_container_size.load().height;
if (width == 0 || height == 0) {
return;
}
std::vector<std::shared_ptr<dcpomatic::Font>> get_subtitle_fonts ();
std::list<ReferencedReelAsset> get_reel_assets ();
dcp::Size video_container_size () const {
- boost::mutex::scoped_lock lm (_mutex);
return _video_container_size;
}
/** Size of the image we are rendering to; this may be the DCP frame size, or
* the size of preview in a window.
*/
- dcp::Size _video_container_size;
+ boost::atomic<dcp::Size> _video_container_size;
std::shared_ptr<Image> _black_image;
/** true if the player should ignore all video; i.e. never produce any */