summaryrefslogtreecommitdiff
path: root/src/lib/player.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2024-02-12 00:06:13 +0100
committerCarl Hetherington <cth@carlh.net>2024-02-12 00:06:13 +0100
commit6f9adc9f7215a362d23e45b861017638ec67c723 (patch)
tree81c07fa6ddc8dca328c269bdfc8f2534c46ccd2c /src/lib/player.cc
parenteade5cc8657f51d1d768b705936e918f8d1f53ee (diff)
parenteb04ac87ccfa046dd342ca7b9e6478c3bdcabbba (diff)
Merge branch 'main' into v2.17.x
Diffstat (limited to 'src/lib/player.cc')
-rw-r--r--src/lib/player.cc12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/lib/player.cc b/src/lib/player.cc
index 888c56aec..3402cc12b 100644
--- a/src/lib/player.cc
+++ b/src/lib/player.cc
@@ -189,6 +189,7 @@ Player::Player(Player&& other)
, _silent(std::move(other._silent))
, _active_texts(std::move(other._active_texts))
, _audio_processor(std::move(other._audio_processor))
+ , _disable_audio_processor(other._disable_audio_processor)
, _playback_length(other._playback_length.load())
, _subtitle_alignment(other._subtitle_alignment)
{
@@ -228,6 +229,7 @@ Player::operator=(Player&& other)
_silent = std::move(other._silent);
_active_texts = std::move(other._active_texts);
_audio_processor = std::move(other._audio_processor);
+ _disable_audio_processor = other._disable_audio_processor;
_playback_length = other._playback_length.load();
_subtitle_alignment = other._subtitle_alignment;
@@ -1191,7 +1193,7 @@ Player::audio (weak_ptr<Piece> weak_piece, AudioStreamPtr stream, ContentAudio c
/* Process */
- if (_audio_processor) {
+ if (_audio_processor && !_disable_audio_processor) {
content_audio.audio = _audio_processor->run(content_audio.audio, film->audio_channels());
}
@@ -1589,3 +1591,11 @@ Player::signal_change(ChangeType type, int property)
Change(type, property, false);
}
+
+/** Must be called from the same thread that calls ::pass() */
+void
+Player::set_disable_audio_processor()
+{
+ _disable_audio_processor = true;
+}
+