Commit 30bd190b authored by Max Kellermann's avatar Max Kellermann

decoder/wavpack: implement scan_stream()

parent cf93cd93
...@@ -28,6 +28,7 @@ ver 0.20 (not yet released) ...@@ -28,6 +28,7 @@ ver 0.20 (not yet released)
- pcm: support audio/L16 (RFC 2586) and audio/x-mpd-float - pcm: support audio/L16 (RFC 2586) and audio/x-mpd-float
- sidplay: faster scanning - sidplay: faster scanning
- wavpack: support DSD (WavPack 5) - wavpack: support DSD (WavPack 5)
- wavpack: archive support
* playlist * playlist
- cue: don't skip pregap - cue: don't skip pregap
- embcue: fix last track - embcue: fix last track
......
...@@ -496,6 +496,24 @@ wavpack_scan_file(Path path_fs, ...@@ -496,6 +496,24 @@ wavpack_scan_file(Path path_fs,
return true; return true;
} }
static bool
wavpack_scan_stream(InputStream &is,
const TagHandler &handler, void *handler_ctx)
{
WavpackInput isp(nullptr, is);
auto *wpc = WavpackOpenInput(&mpd_is_reader, &isp, nullptr,
OPEN_DSD_FLAG, 0);
AtScopeExit(wpc) {
WavpackCloseFile(wpc);
};
const auto duration = GetDuration(wpc);
if (!duration.IsNegative())
tag_handler_invoke_duration(handler, handler_ctx, SongTime(duration));
return true;
}
static char const *const wavpack_suffixes[] = { static char const *const wavpack_suffixes[] = {
"wv", "wv",
nullptr nullptr
...@@ -513,7 +531,7 @@ const struct DecoderPlugin wavpack_decoder_plugin = { ...@@ -513,7 +531,7 @@ const struct DecoderPlugin wavpack_decoder_plugin = {
wavpack_streamdecode, wavpack_streamdecode,
wavpack_filedecode, wavpack_filedecode,
wavpack_scan_file, wavpack_scan_file,
nullptr, wavpack_scan_stream,
nullptr, nullptr,
wavpack_suffixes, wavpack_suffixes,
wavpack_mime_types wavpack_mime_types
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment