Silence the PCM buffer if no chunk is available

This commit is contained in:
badaix 2021-02-03 22:58:21 +01:00
parent 147e4e9b7e
commit 168bc3f98b
7 changed files with 31 additions and 11 deletions

View file

@ -78,10 +78,9 @@ void OpenslPlayer::playerCallback(SLAndroidSimpleBufferQueueItf bq)
return;
chronos::usec delay(ms_ * 1000);
if (!pubStream_->getPlayerChunk(buffer[curBuffer], delay, frames_))
if (!pubStream_->getPlayerChunkOrSilence(buffer[curBuffer], delay, frames_))
{
// LOG(INFO, LOG_TAG) << "Failed to get chunk. Playing silence.\n";
memset(buffer[curBuffer], 0, buff_size);
}
else
{