player/Outputs: abstract interface wrapping class MultipleOutputs

This commit is contained in:
Max Kellermann
2017-12-29 16:23:19 +01:00
parent c04aafb4e3
commit c40354bbcb
7 changed files with 148 additions and 90 deletions

View File

@@ -19,16 +19,16 @@
#include "config.h"
#include "Control.hxx"
#include "Outputs.hxx"
#include "Idle.hxx"
#include "DetachedSong.hxx"
#include "output/MultipleOutputs.hxx"
#include <algorithm>
#include <assert.h>
PlayerControl::PlayerControl(PlayerListener &_listener,
MultipleOutputs &_outputs,
PlayerOutputs &_outputs,
unsigned _buffer_chunks,
unsigned _buffered_before_play,
AudioFormat _configured_audio_format,
@@ -50,10 +50,10 @@ PlayerControl::~PlayerControl() noexcept
bool
PlayerControl::WaitOutputConsumed(unsigned threshold) noexcept
{
bool result = outputs.Check() < threshold;
bool result = outputs.CheckPipe() < threshold;
if (!result && command == PlayerCommand::NONE) {
Wait();
result = outputs.Check() < threshold;
result = outputs.CheckPipe() < threshold;
}
return result;