* Decode a song. * * DecoderControl::mutex is not locked. */
| 496 | * DecoderControl::mutex is not locked. |
| 497 | */ |
| 498 | static DecodeResult |
| 499 | DecoderUnlockedRunUri(DecoderBridge &bridge, |
| 500 | const char *real_uri, Path path_fs) |
| 501 | try { |
| 502 | return !path_fs.IsNull() |
| 503 | ? decoder_run_file(bridge, real_uri, path_fs) |
| 504 | : decoder_run_stream(bridge, real_uri); |
| 505 | } catch (StopDecoder) { |
| 506 | return DecodeResult::STOP; |
| 507 | } catch (...) { |
| 508 | const char *error_uri = real_uri; |
| 509 | const std::string allocated = uri_remove_auth(error_uri); |
| 510 | if (!allocated.empty()) |
| 511 | error_uri = allocated.c_str(); |
| 512 | |
| 513 | std::throw_with_nested(FmtRuntimeError("Failed to decode {:?}", |
| 514 | error_uri)); |
| 515 | } |
| 516 | |
| 517 | /** |
| 518 | * Try to guess whether tags attached to the given song are |
no test coverage detected