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

Function wavpack_streamdecode

src/decoder/plugins/WavpackDecoderPlugin.cxx:419–447  ·  view source on GitHub ↗

* Decodes a stream. */

Source from the content-addressed store, hash-verified

417 * Decodes a stream.
418 */
419static void
420wavpack_streamdecode(DecoderClient &client, InputStream &is)
421{
422 int open_flags = OPEN_DSD_FLAG | OPEN_NORMALIZE;
423 bool can_seek = is.IsSeekable();
424
425 std::unique_ptr<WavpackInput> wvc;
426 auto is_wvc = wavpack_open_wvc(client, is.GetURI());
427 if (is_wvc) {
428 open_flags |= OPEN_WVC;
429 can_seek &= is_wvc->IsSeekable();
430
431 wvc = std::make_unique<WavpackInput>(&client, *is_wvc);
432 }
433
434 if (!can_seek) {
435 open_flags |= OPEN_STREAMING;
436 }
437
438 WavpackInput isp(&client, is);
439
440 auto *wpc = WavpackOpenInput(mpd_is_reader, &isp, wvc.get(),
441 open_flags, 0);
442 AtScopeExit(wpc) {
443 WavpackCloseFile(wpc);
444 };
445
446 wavpack_decode(client, wpc, can_seek);
447}
448
449/*
450 * Decodes a file.

Callers

nothing calls this directly

Calls 5

wavpack_open_wvcFunction · 0.85
WavpackOpenInputFunction · 0.85
wavpack_decodeFunction · 0.85
getMethod · 0.80
GetURIMethod · 0.45

Tested by

no test coverage detected