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

Function FlacSubmitToClient

src/decoder/plugins/FlacDecoderPlugin.cxx:149–172  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

147}
148
149static DecoderCommand
150FlacSubmitToClient(DecoderClient &client, FlacDecoder &d) noexcept
151{
152 if (d.tag.IsEmpty() && d.chunk.empty())
153 return client.GetCommand();
154
155 if (!d.tag.IsEmpty()) {
156 auto cmd = client.SubmitTag(d.GetInputStream(),
157 std::move(d.tag));
158 d.tag.Clear();
159 if (cmd != DecoderCommand::NONE)
160 return cmd;
161 }
162
163 if (!d.chunk.empty()) {
164 auto cmd = client.SubmitAudio(d.GetInputStream(), d.chunk,
165 d.kbit_rate);
166 d.chunk = {};
167 if (cmd != DecoderCommand::NONE)
168 return cmd;
169 }
170
171 return DecoderCommand::NONE;
172}
173
174static void
175flac_decoder_loop(FlacDecoder *data, FLAC__StreamDecoder *flac_dec)

Callers 1

flac_decoder_loopFunction · 0.85

Calls 6

IsEmptyMethod · 0.80
emptyMethod · 0.80
GetCommandMethod · 0.45
SubmitTagMethod · 0.45
ClearMethod · 0.45
SubmitAudioMethod · 0.45

Tested by

no test coverage detected