MCPcopy Create free account
hub / github.com/MusicPlayerDaemon/MPD / DecoderUriDecode

Function DecoderUriDecode

src/decoder/Thread.cxx:74–105  ·  view source on GitHub ↗

* Decode a URI with the given decoder plugin. * * Caller holds DecoderControl::mutex. */

Source from the content-addressed store, hash-verified

72 * Caller holds DecoderControl::mutex.
73 */
74static DecodeResult
75DecoderUriDecode(const DecoderPlugin &plugin,
76 DecoderBridge &bridge, const char *uri)
77{
78 assert(plugin.uri_decode != nullptr);
79 assert(bridge.stream_tag == nullptr);
80 assert(bridge.decoder_tag == nullptr);
81 assert(uri != nullptr);
82 assert(bridge.dc.state == DecoderState::START);
83
84 FmtDebug(decoder_thread_domain, "probing plugin {}", plugin.name);
85
86 if (bridge.dc.command == DecoderCommand::STOP)
87 return DecodeResult::STOP;
88
89 {
90 const ScopeUnlock unlock(bridge.dc.mutex);
91
92 FmtThreadName("decoder:{}", plugin.name);
93
94 plugin.UriDecode(bridge, uri);
95
96 SetThreadName("decoder");
97 }
98
99 assert(bridge.dc.state == DecoderState::START ||
100 bridge.dc.state == DecoderState::DECODE);
101
102 return bridge.dc.state == DecoderState::START
103 ? DecodeResult::UNRECOGNIZED_FILE
104 : DecodeResult::SUCCESS;
105}
106
107/**
108 * Decode a stream with the given decoder plugin.

Callers 1

TryUriDecodeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected