player/Thread: catch and log initialization errors

This commit is contained in:
Max Kellermann 2018-09-21 17:35:32 +02:00
parent 9a2d71341e
commit 781e690012
1 changed files with 9 additions and 1 deletions

View File

@ -1098,7 +1098,7 @@ do_play(PlayerControl &pc, DecoderControl &dc,
void
PlayerControl::RunThread() noexcept
{
try {
SetThreadName("player");
DecoderControl dc(mutex, cond,
@ -1185,4 +1185,12 @@ PlayerControl::RunThread() noexcept
break;
}
}
} catch (...) {
/* exceptions caught here are thrown during initialization;
the main loop doesn't throw */
LogError(std::current_exception());
/* TODO: what now? How will the main thread learn about this
failure? */
}