, _playlist (playlist)
, _have_valid_pieces (false)
, _ignore_video (false)
+ , _ignore_audio (false)
, _ignore_text (false)
, _always_burn_open_subtitles (false)
, _fast (false)
continue;
}
+ if (_ignore_video && _ignore_audio && i->text.empty()) {
+ /* We're only interested in text and this content has none */
+ continue;
+ }
+
shared_ptr<Decoder> decoder = decoder_factory (i, _film->log(), _fast);
FrameRateChange frc (i->active_video_frame_rate(), _film->video_frame_rate());
decoder->video->set_ignore (true);
}
+ if (decoder->audio && _ignore_audio) {
+ decoder->audio->set_ignore (true);
+ }
+
if (_ignore_text) {
BOOST_FOREACH (shared_ptr<TextDecoder> i, decoder->text) {
i->set_ignore (true);
void
Player::set_video_container_size (dcp::Size s)
{
- if (s == _video_container_size) {
- return;
- }
+ {
+ boost::mutex::scoped_lock lm (_mutex);
- _video_container_size = s;
+ if (s == _video_container_size) {
+ return;
+ }
- _black_image.reset (new Image (AV_PIX_FMT_RGB24, _video_container_size, true));
- _black_image->make_black ();
+ _video_container_size = s;
+
+ _black_image.reset (new Image (AV_PIX_FMT_RGB24, _video_container_size, true));
+ _black_image->make_black ();
+ }
Changed (PlayerProperty::VIDEO_CONTAINER_SIZE, false);
}
list<shared_ptr<Font> >
Player::get_subtitle_fonts ()
{
+ /* Does not require a lock on _mutex as it's only called from DCPEncoder */
+
if (!_have_valid_pieces) {
setup_pieces ();
}
void
Player::set_ignore_video ()
{
+ boost::mutex::scoped_lock lm (_mutex);
_ignore_video = true;
+ _have_valid_pieces = false;
+}
+
+void
+Player::set_ignore_audio ()
+{
+ _ignore_audio = true;
+ _have_valid_pieces = false;
}
void
Player::set_ignore_text ()
{
+ boost::mutex::scoped_lock lm (_mutex);
_ignore_text = true;
}
void
Player::set_always_burn_open_subtitles ()
{
+ boost::mutex::scoped_lock lm (_mutex);
_always_burn_open_subtitles = true;
}
void
Player::set_fast ()
{
+ boost::mutex::scoped_lock lm (_mutex);
_fast = true;
_have_valid_pieces = false;
}
void
Player::set_play_referenced ()
{
+ boost::mutex::scoped_lock lm (_mutex);
_play_referenced = true;
_have_valid_pieces = false;
}
list<ReferencedReelAsset>
Player::get_reel_assets ()
{
+ /* Does not require a lock on _mutex as it's only called from DCPEncoder */
+
list<ReferencedReelAsset> a;
BOOST_FOREACH (shared_ptr<Content> i, _playlist->content ()) {
bool
Player::pass ()
{
+ boost::mutex::scoped_lock lm (_mutex);
+
if (!_have_valid_pieces) {
setup_pieces ();
}
list<PlayerText>
Player::closed_captions_for_frame (DCPTime time) const
{
+ boost::mutex::scoped_lock _lm (_mutex);
return _active_texts[TEXT_CLOSED_CAPTION].get (
DCPTimePeriod(time, time + DCPTime::from_frames(1, _film->video_frame_rate()))
);
void
Player::seek (DCPTime time, bool accurate)
{
+ boost::mutex::scoped_lock lm (_mutex);
+
if (!_have_valid_pieces) {
setup_pieces ();
}
void
Player::set_dcp_decode_reduction (optional<int> reduction)
{
- if (reduction == _dcp_decode_reduction) {
- return;
+ {
+ boost::mutex::scoped_lock lm (_mutex);
+
+ if (reduction == _dcp_decode_reduction) {
+ return;
+ }
+
+ _dcp_decode_reduction = reduction;
+ _have_valid_pieces = false;
}
- _dcp_decode_reduction = reduction;
- _have_valid_pieces = false;
Changed (PlayerProperty::DCP_DECODE_REDUCTION, false);
}
DCPTime
Player::content_time_to_dcp (shared_ptr<Content> content, ContentTime t)
{
+ boost::mutex::scoped_lock lm (_mutex);
+
if (_have_valid_pieces) {
setup_pieces ();
}