player/Thread: catch and log initialization errors
This commit is contained in:
@@ -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
|
|||||||
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? */
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user