Updated da_DK translation from Anders Uhl Pedersen.
[dcpomatic.git] / src / lib / audio_ring_buffers.cc
index b4fea485e8d795ea79052139fffc6923551ac234..4e0b3338237fd268c322d90bbacd03ec19a3bec9 100644 (file)
@@ -34,7 +34,7 @@ AudioRingBuffers::AudioRingBuffers ()
 }
 
 void
-AudioRingBuffers::put (shared_ptr<const AudioBuffers> data, DCPTime time)
+AudioRingBuffers::put (shared_ptr<const AudioBuffers> data)
 {
        boost::mutex::scoped_lock lm (_mutex);
 
@@ -43,10 +43,10 @@ AudioRingBuffers::put (shared_ptr<const AudioBuffers> data, DCPTime time)
        }
 
        _buffers.push_back (data);
-       _latest = time;
 }
 
-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);
@@ -59,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 ();
@@ -83,6 +83,8 @@ AudioRingBuffers::get (float* out, int channels, int frames)
                        _used_in_head = 0;
                }
        }
+
+       return false;
 }
 
 void
@@ -91,11 +93,10 @@ AudioRingBuffers::clear ()
        boost::mutex::scoped_lock lm (_mutex);
        _buffers.clear ();
        _used_in_head = 0;
-       _latest = DCPTime ();
 }
 
 Frame
-AudioRingBuffers::size ()
+AudioRingBuffers::size () const
 {
        boost::mutex::scoped_lock lm (_mutex);
        Frame s = 0;