Commit 781e6900 authored by Max Kellermann's avatar Max Kellermann

player/Thread: catch and log initialization errors

parent 9a2d7134
...@@ -1098,7 +1098,7 @@ do_play(PlayerControl &pc, DecoderControl &dc, ...@@ -1098,7 +1098,7 @@ do_play(PlayerControl &pc, DecoderControl &dc,
void void
PlayerControl::RunThread() noexcept PlayerControl::RunThread() noexcept
{ try {
SetThreadName("player"); SetThreadName("player");
DecoderControl dc(mutex, cond, DecoderControl dc(mutex, cond,
...@@ -1185,4 +1185,12 @@ PlayerControl::RunThread() noexcept ...@@ -1185,4 +1185,12 @@ PlayerControl::RunThread() noexcept
break; 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? */
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment