projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix incorrect reel lengths when start-trimmed movie content follows
[dcpomatic.git]
/
src
/
lib
/
audio_ring_buffers.cc
diff --git
a/src/lib/audio_ring_buffers.cc
b/src/lib/audio_ring_buffers.cc
index 59f06a7c06ab378aabc75415faa55d66404c4a56..42115efa3e786835cfb7e62b20e31b80d8095f1f 100644
(file)
--- a/
src/lib/audio_ring_buffers.cc
+++ b/
src/lib/audio_ring_buffers.cc
@@
-22,6
+22,7
@@
#include "dcpomatic_assert.h"
#include "exceptions.h"
#include <boost/foreach.hpp>
#include "dcpomatic_assert.h"
#include "exceptions.h"
#include <boost/foreach.hpp>
+#include <iostream>
using std::min;
using std::cout;
using std::min;
using std::cout;
@@
-45,7
+46,8
@@
AudioRingBuffers::put (shared_ptr<const AudioBuffers> data)
_buffers.push_back (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);
AudioRingBuffers::get (float* out, int channels, int frames)
{
boost::mutex::scoped_lock lm (_mutex);
@@
-58,7
+60,7
@@
AudioRingBuffers::get (float* out, int channels, int frames)
}
}
cout << "audio underrun; missing " << frames << "!\n";
}
}
cout << "audio underrun; missing " << frames << "!\n";
- return;
+ return
true
;
}
shared_ptr<const AudioBuffers> front = _buffers.front ();
}
shared_ptr<const AudioBuffers> front = _buffers.front ();
@@
-82,6
+84,8
@@
AudioRingBuffers::get (float* out, int channels, int frames)
_used_in_head = 0;
}
}
_used_in_head = 0;
}
}
+
+ return false;
}
void
}
void