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

Function flac_decoder_initialize

src/decoder/plugins/FlacDecoderPlugin.cxx:124–147  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

122}
123
124static bool
125flac_decoder_initialize(FlacDecoder *data, FLAC__StreamDecoder *sd) noexcept
126{
127 if (!FLAC__stream_decoder_process_until_end_of_metadata(sd)) {
128 if (FLAC__stream_decoder_get_state(sd) != FLAC__STREAM_DECODER_END_OF_STREAM)
129 LogWarning(flac_domain, "problem reading metadata");
130 return false;
131 }
132
133 if (data->initialized) {
134 /* done */
135 return true;
136 }
137
138 if (data->GetInputStream().IsSeekable())
139 /* allow the workaround below only for nonseekable
140 streams*/
141 return false;
142
143 /* no stream_info packet found; try to initialize the decoder
144 from the first frame header */
145 FLAC__stream_decoder_process_single(sd);
146 return data->initialized;
147}
148
149static DecoderCommand
150FlacSubmitToClient(DecoderClient &client, FlacDecoder &d) noexcept

Callers 1

FlacInitAndDecodeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected