summaryrefslogtreecommitdiff
path: root/src/wx/film_viewer.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2024-07-25 16:27:31 +0200
committerCarl Hetherington <cth@carlh.net>2024-07-26 11:39:59 +0200
commitce34d8e16db29c358e21337be985600cef8a5044 (patch)
tree67b757bfbe592b94e694c21293b19dd716004867 /src/wx/film_viewer.cc
parent85ddc6ae876810b618e632365c89d06ad60f8b3b (diff)
Add AudioBackend::start_stream().
Diffstat (limited to 'src/wx/film_viewer.cc')
-rw-r--r--src/wx/film_viewer.cc17
1 files changed, 3 insertions, 14 deletions
diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc
index 65e2afb56..1876aac74 100644
--- a/src/wx/film_viewer.cc
+++ b/src/wx/film_viewer.cc
@@ -353,25 +353,14 @@ FilmViewer::start_audio_stream_if_open ()
if (audio.isStreamOpen()) {
audio.setStreamTime(_video_view->position().seconds());
-#if (RTAUDIO_VERSION_MAJOR >= 6)
- if (audio.startStream() != RTAUDIO_NO_ERROR) {
+ auto error = AudioBackend::instance()->start_stream();
+ if (error) {
_audio_channels = 0;
error_dialog(
_video_view->get(),
- _("There was a problem starting audio playback. Please try another audio output device in Preferences."), std_to_wx(audio.last_rtaudio_error())
- );
- }
-#else
- try {
- audio.startStream ();
- } catch (RtAudioError& e) {
- _audio_channels = 0;
- error_dialog (
- _video_view->get(),
- _("There was a problem starting audio playback. Please try another audio output device in Preferences."), std_to_wx(e.what())
+ _("There was a problem starting audio playback. Please try another audio output device in Preferences."), std_to_wx(*error)
);
}
-#endif
}
}