Skip to content

Commit

Permalink
sndio: Make use of the sio_flush() function
Browse files Browse the repository at this point in the history
Use sio_flush() instead of sio_stop() to improve controls responsiveness.

Co-authored-by: Brad Smith <[email protected]>
  • Loading branch information
radioactiveman and brad0 committed Jun 28, 2024
1 parent 7efce22 commit 0e9361e
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 4 deletions.
15 changes: 11 additions & 4 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -404,12 +404,19 @@ ENABLE_PLUGIN_WITH_DEP(pulse,
PULSE,
libpulse >= 0.9.5)

ENABLE_PLUGIN_WITH_DEP(sndio,
test_sndio () {
PKG_CHECK_MODULES(SNDIO, sndio >= 1.9, [
AC_DEFINE(HAVE_SNDIO_1_9, 1, [Define if sndio version is >= 1.9])
have_sndio=yes
], [
PKG_CHECK_MODULES(SNDIO, sndio, have_sndio=yes, have_sndio=no)
])
}

ENABLE_PLUGIN_WITH_TEST(sndio,
Sndio output,
auto,
OUTPUT,
SNDIO,
sndio)
OUTPUT)

test_cue () {
PKG_CHECK_MODULES(CUE, libcue >= 2.0, [
Expand Down
1 change: 1 addition & 0 deletions src/config.h.meson
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#mesondefine FILEWRITER_VORBIS

#mesondefine HAVE_LIBCUE2
#mesondefine HAVE_SNDIO_1_9

#mesondefine HAVE_ADPLUG_NEMUOPL_H
#mesondefine HAVE_ADPLUG_WEMUOPL_H
Expand Down
5 changes: 5 additions & 0 deletions src/sndio/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ sndio_dep = dependency('sndio', required: false)
have_sndio = sndio_dep.found()


if sndio_dep.version().version_compare('>= 1.9.0')
conf.set10('HAVE_SNDIO_1_9', true)
endif


if have_sndio
shared_module('sndio-ng',
'sndio.cc',
Expand Down
4 changes: 4 additions & 0 deletions src/sndio/sndio.cc
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,11 @@ void SndioPlugin::flush ()
{
pthread_mutex_lock (& m_mutex);

#if HAVE_SNDIO_1_9
sio_flush (m_handle);
#else
sio_stop (m_handle);
#endif

m_frames_buffered = 0;
m_last_write_time = timeval ();
Expand Down

0 comments on commit 0e9361e

Please sign in to comment.