decoder/wavpack: implement scan_stream()

This commit is contained in:
Max Kellermann 2016-12-09 23:14:58 +01:00
parent cf93cd9307
commit 30bd190b41
2 changed files with 20 additions and 1 deletions

1
NEWS
View File

@ -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

View File

@ -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 = {
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