mirror of
https://github.com/badaix/snapcast.git
synced 2025-05-10 23:56:43 +02:00
Rename stream parameter "read_ms" to "chunk_ms"
This commit is contained in:
parent
b5551d9451
commit
aa3ce3d5ab
13 changed files with 79 additions and 63 deletions
|
@ -46,7 +46,7 @@ PipeStream::PipeStream(PcmListener* pcmListener, boost::asio::io_context& ioc, c
|
|||
if ((mkfifo(uri_.path.c_str(), 0666) != 0) && (errno != EEXIST))
|
||||
throw SnapException("failed to make fifo \"" + uri_.path + "\": " + cpt::to_string(errno));
|
||||
}
|
||||
chunk_ = make_unique<msg::PcmChunk>(sampleFormat_, pcmReadMs_);
|
||||
chunk_ = make_unique<msg::PcmChunk>(sampleFormat_, chunk_ms_);
|
||||
}
|
||||
|
||||
|
||||
|
@ -81,7 +81,8 @@ void PipeStream::do_read()
|
|||
int count = read(fd_, chunk_->payload + len, toRead - len);
|
||||
if (count < 0)
|
||||
{
|
||||
LOG(DEBUG) << "count < 0: " << errno << " && idleBytes < maxIdleBytes, ms: " << 1000 * chunk_->payloadSize / (sampleFormat_.rate * sampleFormat_.frameSize) << "\n";
|
||||
LOG(DEBUG) << "count < 0: " << errno
|
||||
<< " && idleBytes < maxIdleBytes, ms: " << 1000 * chunk_->payloadSize / (sampleFormat_.rate * sampleFormat_.frameSize) << "\n";
|
||||
memset(chunk_->payload + len, 0, toRead - len);
|
||||
len += toRead - len;
|
||||
break;
|
||||
|
@ -105,7 +106,7 @@ void PipeStream::do_read()
|
|||
nextTick_ = chronos::getTickCount() + buffer_ms_;
|
||||
}
|
||||
encoder_->encode(chunk_.get());
|
||||
nextTick_ += pcmReadMs_;
|
||||
nextTick_ += chunk_ms_;
|
||||
long currentTick = chronos::getTickCount();
|
||||
|
||||
if (nextTick_ >= currentTick)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue