mirror of
https://github.com/badaix/snapcast.git
synced 2025-06-05 20:31:42 +02:00
Add meta stream source
This commit is contained in:
parent
f1e672d375
commit
27a9e710a2
20 changed files with 367 additions and 64 deletions
|
@ -120,8 +120,7 @@ void AsioStream<ReadStream>::check_state()
|
|||
template <typename ReadStream>
|
||||
void AsioStream<ReadStream>::start()
|
||||
{
|
||||
encoder_->init(this, sampleFormat_);
|
||||
active_ = true;
|
||||
PcmStream::start();
|
||||
check_state();
|
||||
connect();
|
||||
}
|
||||
|
@ -198,7 +197,7 @@ void AsioStream<ReadStream>::do_read()
|
|||
nextTick_ = std::chrono::steady_clock::now();
|
||||
}
|
||||
|
||||
onChunkRead(*chunk_);
|
||||
chunkRead(*chunk_);
|
||||
nextTick_ += chunk_->duration<std::chrono::nanoseconds>();
|
||||
auto currentTick = std::chrono::steady_clock::now();
|
||||
|
||||
|
@ -221,7 +220,7 @@ void AsioStream<ReadStream>::do_read()
|
|||
// Read took longer, wait for the buffer to fill up
|
||||
else
|
||||
{
|
||||
pcmListener_->onResync(this, std::chrono::duration_cast<std::chrono::milliseconds>(currentTick - nextTick_).count());
|
||||
resync(std::chrono::duration_cast<std::chrono::nanoseconds>(currentTick - nextTick_));
|
||||
nextTick_ = currentTick + std::chrono::milliseconds(buffer_ms_);
|
||||
first_ = true;
|
||||
do_read();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue