mirror of
https://github.com/badaix/snapcast.git
synced 2025-07-26 21:08:54 +02:00
Add "Init start" and "Init done" loglines
to detect if the player hangs and to kill and restart snapclient
This commit is contained in:
parent
a013558e81
commit
ea3eb988a9
2 changed files with 10 additions and 6 deletions
|
@ -158,6 +158,8 @@ void OpenslPlayer::initOpensl()
|
|||
if (active_)
|
||||
return;
|
||||
|
||||
LOG(INFO, LOG_TAG) << "Init start\n";
|
||||
|
||||
const SampleFormat& format = stream_->getFormat();
|
||||
|
||||
|
||||
|
@ -225,7 +227,7 @@ void OpenslPlayer::initOpensl()
|
|||
|
||||
SLuint32 bitsPerSample = SL_PCMSAMPLEFORMAT_FIXED_16;
|
||||
SLuint32 containerSize = SL_PCMSAMPLEFORMAT_FIXED_16;
|
||||
switch (format.bits)
|
||||
switch (format.bits())
|
||||
{
|
||||
case 8:
|
||||
bitsPerSample = SL_PCMSAMPLEFORMAT_FIXED_8;
|
||||
|
@ -244,7 +246,7 @@ void OpenslPlayer::initOpensl()
|
|||
containerSize = SL_PCMSAMPLEFORMAT_FIXED_32;
|
||||
break;
|
||||
default:
|
||||
throw SnapException("Unsupported sample format: " + cpt::to_string(format.bits));
|
||||
throw SnapException("Unsupported sample format: " + cpt::to_string(format.bits()));
|
||||
}
|
||||
|
||||
|
||||
|
@ -297,6 +299,7 @@ void OpenslPlayer::initOpensl()
|
|||
result = (*bqPlayerBufferQueue)->Enqueue(bqPlayerBufferQueue, buffer[curBuffer], sizeof(buffer[curBuffer]));
|
||||
throwUnsuccess(kPhaseInit, "PlayerBufferQueue::Enqueue", result);
|
||||
curBuffer ^= 1;
|
||||
LOG(INFO, LOG_TAG) << "Init done\n";
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue