summaryrefslogtreecommitdiff
path: root/src/lib/butler.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2017-07-12 23:20:22 +0100
committerCarl Hetherington <cth@carlh.net>2017-07-12 23:20:22 +0100
commit71ab83292da50b080befd98b01804a120b94f65e (patch)
treefd55691ab20b1528b23f9b4469f5d7f6cf2bad6c /src/lib/butler.cc
parentfaa471f2399241277e1220c9330cd4cd4cf27f26 (diff)
Report underruns from Butler::get_audio.
Diffstat (limited to 'src/lib/butler.cc')
-rw-r--r--src/lib/butler.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/lib/butler.cc b/src/lib/butler.cc
index 54c1acc4d..771c4e633 100644
--- a/src/lib/butler.cc
+++ b/src/lib/butler.cc
@@ -226,11 +226,16 @@ Butler::player_changed ()
}
}
-void
+/** Try to get `frames' frames of audio and copy it into `out'. Silence
+ * will be filled if no audio is available.
+ * @return true if there was a buffer underrun, otherwise false.
+ */
+bool
Butler::get_audio (float* out, Frame frames)
{
- _audio.get (out, _audio_channels, frames);
+ bool const underrun = _audio.get (out, _audio_channels, frames);
_summon.notify_all ();
+ return underrun;
}
void