_pending_seek_position = position;
_pending_seek_accurate = accurate;
- {
- boost::mutex::scoped_lock lm (_buffers_mutex);
- _video.clear ();
- _audio.clear ();
- _closed_caption.clear ();
- }
+ _video.clear ();
+ _audio.clear ();
+ _closed_caption.clear ();
_summon.notify_all ();
}
_prepare_service.post (bind (&Butler::prepare, this, weak_ptr<PlayerVideo>(video)));
- boost::mutex::scoped_lock lm2 (_buffers_mutex);
_video.put (video, time);
}
void
Butler::audio (shared_ptr<AudioBuffers> audio, DCPTime time, int frame_rate)
{
- {
- boost::mutex::scoped_lock lm (_mutex);
- if (_pending_seek_position || _disable_audio) {
- /* Don't store any audio in these cases */
- return;
- }
+ boost::mutex::scoped_lock lm (_mutex);
+ if (_pending_seek_position || _disable_audio) {
+ /* Don't store any audio in these cases */
+ return;
}
- boost::mutex::scoped_lock lm2 (_buffers_mutex);
_audio.put (remap (audio, _audio_channels, _audio_mapping), time, frame_rate);
}
DCPOMATIC_ASSERT (track);
- boost::mutex::scoped_lock lm2 (_buffers_mutex);
_closed_caption.put (pt, *track, period);
}
boost::shared_ptr<Player> _player;
boost::thread* _thread;
- /** mutex to protect _video, _audio and _closed_caption for when we are clearing them and they all need to be
- cleared together without any data being inserted in the interim;
- XXX: is this necessary now that all butler output data is timestamped? Perhaps the locked clear-out
- is only required if we guarantee that get_video() and get_audio() calls are in sync.
- */
- boost::mutex _buffers_mutex;
VideoRingBuffers _video;
AudioRingBuffers _audio;
TextRingBuffers _closed_caption;