|
|
|
@ -91,9 +91,10 @@ public:
|
|
|
|
|
* @param core_timing - The CoreTiming instance
|
|
|
|
|
* @param session - The device session
|
|
|
|
|
*
|
|
|
|
|
* @return Is the buffer was released.
|
|
|
|
|
* @return If any buffer was released.
|
|
|
|
|
*/
|
|
|
|
|
bool ReleaseBuffers(const Core::Timing::CoreTiming& core_timing, const DeviceSession& session) {
|
|
|
|
|
bool ReleaseBuffers(const Core::Timing::CoreTiming& core_timing, const DeviceSession& session,
|
|
|
|
|
bool force) {
|
|
|
|
|
std::scoped_lock l{lock};
|
|
|
|
|
bool buffer_released{false};
|
|
|
|
|
while (registered_count > 0) {
|
|
|
|
@ -103,7 +104,8 @@ public:
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Check with the backend if this buffer can be released yet.
|
|
|
|
|
if (!session.IsBufferConsumed(buffers[index])) {
|
|
|
|
|
// If we're shutting down, we don't care if it's been played or not.
|
|
|
|
|
if (!force && !session.IsBufferConsumed(buffers[index])) {
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|