diff options
| author | Carl Hetherington <cth@carlh.net> | 2024-09-12 01:01:20 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2024-09-12 01:01:20 +0200 |
| commit | 87bb0c4dfe0da21d7d091aee5eda99d78190bd42 (patch) | |
| tree | bd8ca63da1058453b4012185218a64159b08d9c6 | |
| parent | 5121341a45a940a170c5c07dcef432f0fc90b476 (diff) | |
Cleanup: add AudioBackend::close_stream().
| -rw-r--r-- | src/wx/audio_backend.cc | 8 | ||||
| -rw-r--r-- | src/wx/audio_backend.h | 1 | ||||
| -rw-r--r-- | src/wx/film_viewer.cc | 3 |
3 files changed, 10 insertions, 2 deletions
diff --git a/src/wx/audio_backend.cc b/src/wx/audio_backend.cc index c43153c81..dd1ad2b6d 100644 --- a/src/wx/audio_backend.cc +++ b/src/wx/audio_backend.cc @@ -325,3 +325,11 @@ AudioBackend::open_stream(optional<string> name, RtAudioCallback callback, void* return true; } + + +void +AudioBackend::close_stream() +{ + _rtaudio.closeStream(); +} + diff --git a/src/wx/audio_backend.h b/src/wx/audio_backend.h index 9a478d4fb..7f618e6fb 100644 --- a/src/wx/audio_backend.h +++ b/src/wx/audio_backend.h @@ -49,6 +49,7 @@ public: bool open_stream(boost::optional<std::string> name, RtAudioCallback callback, void* context, int* channels, unsigned int* block_size); void abort_stream_if_running(); boost::optional<std::string> start_stream(); + void close_stream(); int stream_latency() const; bool stream_open() const; diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc index 987fd5b39..4aba8773a 100644 --- a/src/wx/film_viewer.cc +++ b/src/wx/film_viewer.cc @@ -603,10 +603,9 @@ FilmViewer::config_changed (Config::Property p) } auto backend = AudioBackend::instance(); - auto& audio = backend->rtaudio(); if (backend->stream_open()) { - audio.closeStream(); + backend->close_stream(); } if (Config::instance()->sound() && backend->device_count() > 0) { |
