mirror of
https://github.com/badaix/snapcast.git
synced 2025-04-29 02:07:55 +02:00
Catch exception during pulse connect
This commit is contained in:
parent
e7f1519ab2
commit
dd180dc56a
1 changed files with 12 additions and 2 deletions
|
@ -189,10 +189,20 @@ void PulsePlayer::worker()
|
|||
LOG(DEBUG, LOG_TAG) << "Waiting for a chunk to become available before reconnecting\n";
|
||||
}
|
||||
|
||||
if (active_)
|
||||
while (active_)
|
||||
{
|
||||
LOG(INFO, LOG_TAG) << "Chunk available, reconnecting to pulse\n";
|
||||
this->connect();
|
||||
try
|
||||
{
|
||||
connect();
|
||||
break;
|
||||
}
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
LOG(ERROR, LOG_TAG) << "Exception while connecting to pulse: " << e.what() << endl;
|
||||
disconnect();
|
||||
chronos::sleep(100);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue