mirror of
https://github.com/badaix/snapcast.git
synced 2025-06-07 05:11:43 +02:00
Silence the PCM buffer if no chunk is available
This commit is contained in:
parent
147e4e9b7e
commit
168bc3f98b
7 changed files with 31 additions and 11 deletions
|
@ -108,7 +108,7 @@ void CoreAudioPlayer::playerCallback(AudioQueueRef queue, AudioQueueBufferRef bu
|
|||
/// TODO: sometimes this bufferedMS or AudioTimeStamp wraps around 1s (i.e. we're 1s out of sync (behind)) and recovers later on
|
||||
chronos::usec delay(bufferedMs * 1000);
|
||||
char* buffer = (char*)bufferRef->mAudioData;
|
||||
if (!pubStream_->getPlayerChunk(buffer, delay, frames_))
|
||||
if (!pubStream_->getPlayerChunkOrSilence(buffer, delay, frames_))
|
||||
{
|
||||
if (chronos::getTickCount() - lastChunkTick > 5000)
|
||||
{
|
||||
|
@ -117,7 +117,6 @@ void CoreAudioPlayer::playerCallback(AudioQueueRef queue, AudioQueueBufferRef bu
|
|||
return;
|
||||
}
|
||||
// LOG(INFO, LOG_TAG) << "Failed to get chunk. Playing silence.\n";
|
||||
memset(buffer, 0, buff_size_);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue