diff options
| author | Carl Hetherington <cth@carlh.net> | 2017-07-12 23:20:22 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2017-07-12 23:20:22 +0100 |
| commit | 71ab83292da50b080befd98b01804a120b94f65e (patch) | |
| tree | fd55691ab20b1528b23f9b4469f5d7f6cf2bad6c /src | |
| parent | faa471f2399241277e1220c9330cd4cd4cf27f26 (diff) | |
Report underruns from Butler::get_audio.
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/butler.cc | 9 | ||||
| -rw-r--r-- | src/lib/butler.h | 2 |
2 files changed, 8 insertions, 3 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 diff --git a/src/lib/butler.h b/src/lib/butler.h index f68504f0e..9949ab79b 100644 --- a/src/lib/butler.h +++ b/src/lib/butler.h @@ -40,7 +40,7 @@ public: void seek (DCPTime position, bool accurate); std::pair<boost::shared_ptr<PlayerVideo>, DCPTime> get_video (); - void get_audio (float* out, Frame frames); + bool get_audio (float* out, Frame frames); void disable_audio (); |
