* * Caller holds DecoderControl::mutex. */
| 603 | * Caller holds DecoderControl::mutex. |
| 604 | */ |
| 605 | static void |
| 606 | decoder_run(DecoderControl &dc) noexcept |
| 607 | try { |
| 608 | dc.ClearError(); |
| 609 | |
| 610 | assert(dc.song != nullptr); |
| 611 | const DetachedSong &song = *dc.song; |
| 612 | |
| 613 | const char *const uri_utf8 = song.GetRealURI(); |
| 614 | |
| 615 | Path path_fs = nullptr; |
| 616 | AllocatedPath path_buffer = nullptr; |
| 617 | if (PathTraitsUTF8::IsAbsolute(uri_utf8)) { |
| 618 | path_buffer = AllocatedPath::FromUTF8Throw(uri_utf8); |
| 619 | path_fs = path_buffer; |
| 620 | } |
| 621 | |
| 622 | decoder_run_song(dc, song, uri_utf8, path_fs); |
| 623 | } catch (...) { |
| 624 | dc.state = DecoderState::ERROR; |
| 625 | dc.command = DecoderCommand::NONE; |
| 626 | dc.error = std::current_exception(); |
| 627 | dc.client_cond.notify_one(); |
| 628 | } |
| 629 | |
| 630 | void |
| 631 | DecoderControl::RunThread() noexcept |
no test coverage detected