diff options
| author | Carl Hetherington <cth@carlh.net> | 2017-04-19 10:56:44 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2017-04-19 23:04:32 +0100 |
| commit | 565a0ab9fc8be5c21685b019aa06d37e6c66160c (patch) | |
| tree | f69349ecb0231f9babeeba26749edd17be02e65b /src/lib/butler.cc | |
| parent | 7a68de9aa2aba678f9ae9c6f9e11d9fc20c1c8e2 (diff) | |
Config option to disable preview audio.
Diffstat (limited to 'src/lib/butler.cc')
| -rw-r--r-- | src/lib/butler.cc | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/lib/butler.cc b/src/lib/butler.cc index aadfc4fe5..32d607c5d 100644 --- a/src/lib/butler.cc +++ b/src/lib/butler.cc @@ -44,6 +44,7 @@ Butler::Butler (weak_ptr<const Film> film, shared_ptr<Player> player, AudioMappi , _audio_mapping (audio_mapping) , _audio_channels (audio_channels) , _stop_thread (false) + , _disable_audio (false) { _player_video_connection = _player->Video.connect (bind (&Butler::video, this, _1, _2)); _player_audio_connection = _player->Audio.connect (bind (&Butler::audio, this, _1, _2)); @@ -158,8 +159,8 @@ Butler::audio (shared_ptr<AudioBuffers> audio, DCPTime time) { { boost::mutex::scoped_lock lm (_mutex); - if (_pending_seek_position) { - /* Don't store any audio while a seek is pending */ + if (_pending_seek_position || _disable_audio) { + /* Don't store any audio while a seek is pending, or if audio is disabled */ return; } } @@ -191,3 +192,10 @@ Butler::get_audio (float* out, Frame frames) _audio.get (out, _audio_channels, frames); _summon.notify_all (); } + +void +Butler::disable_audio () +{ + boost::mutex::scoped_lock lm (_mutex); + _disable_audio = true; +} |
