output/Multiple: move Wait() to struct PlayerControl
Eliminate a dependency from MultipleOutputs on PlayerControl.
This commit is contained in:
@@ -280,6 +280,23 @@ struct PlayerControl {
|
||||
CommandFinished();
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the size of the #MusicPipe is below the #threshold. If
|
||||
* not, it attempts to synchronize with all output threads, and waits
|
||||
* until another #MusicChunk is finished.
|
||||
*
|
||||
* Caller must lock the mutex.
|
||||
*
|
||||
* @param threshold the maximum number of chunks in the pipe
|
||||
* @return true if there are less than #threshold chunks in the pipe
|
||||
*/
|
||||
bool WaitOutputConsumed(unsigned threshold);
|
||||
|
||||
bool LockWaitOutputConsumed(unsigned threshold) {
|
||||
const ScopeLock protect(mutex);
|
||||
return WaitOutputConsumed(threshold);
|
||||
}
|
||||
|
||||
private:
|
||||
/**
|
||||
* Wait for the command to be finished by the player thread.
|
||||
|
Reference in New Issue
Block a user