summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib/audio_ring_buffers.cc7
-rw-r--r--src/lib/audio_ring_buffers.h2
2 files changed, 6 insertions, 3 deletions
diff --git a/src/lib/audio_ring_buffers.cc b/src/lib/audio_ring_buffers.cc
index 59f06a7c0..4e0b33382 100644
--- a/src/lib/audio_ring_buffers.cc
+++ b/src/lib/audio_ring_buffers.cc
@@ -45,7 +45,8 @@ AudioRingBuffers::put (shared_ptr<const AudioBuffers> data)
_buffers.push_back (data);
}
-void
+/** @return true if there was an underrun, otherwise false */
+bool
AudioRingBuffers::get (float* out, int channels, int frames)
{
boost::mutex::scoped_lock lm (_mutex);
@@ -58,7 +59,7 @@ AudioRingBuffers::get (float* out, int channels, int frames)
}
}
cout << "audio underrun; missing " << frames << "!\n";
- return;
+ return true;
}
shared_ptr<const AudioBuffers> front = _buffers.front ();
@@ -82,6 +83,8 @@ AudioRingBuffers::get (float* out, int channels, int frames)
_used_in_head = 0;
}
}
+
+ return false;
}
void
diff --git a/src/lib/audio_ring_buffers.h b/src/lib/audio_ring_buffers.h
index 8f180042e..3c726425c 100644
--- a/src/lib/audio_ring_buffers.h
+++ b/src/lib/audio_ring_buffers.h
@@ -34,7 +34,7 @@ public:
AudioRingBuffers ();
void put (boost::shared_ptr<const AudioBuffers> data);
- void get (float* out, int channels, int frames);
+ bool get (float* out, int channels, int frames);
void clear ();
Frame size () const;