decoder/wavpack: implement scan_stream()
This commit is contained in:
parent
cf93cd9307
commit
30bd190b41
1
NEWS
1
NEWS
|
@ -28,6 +28,7 @@ ver 0.20 (not yet released)
|
|||
- pcm: support audio/L16 (RFC 2586) and audio/x-mpd-float
|
||||
- sidplay: faster scanning
|
||||
- wavpack: support DSD (WavPack 5)
|
||||
- wavpack: archive support
|
||||
* playlist
|
||||
- cue: don't skip pregap
|
||||
- embcue: fix last track
|
||||
|
|
|
@ -496,6 +496,24 @@ wavpack_scan_file(Path path_fs,
|
|||
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[] = {
|
||||
"wv",
|
||||
nullptr
|
||||
|
@ -513,7 +531,7 @@ const struct DecoderPlugin wavpack_decoder_plugin = {
|
|||
wavpack_streamdecode,
|
||||
wavpack_filedecode,
|
||||
wavpack_scan_file,
|
||||
nullptr,
|
||||
wavpack_scan_stream,
|
||||
nullptr,
|
||||
wavpack_suffixes,
|
||||
wavpack_mime_types
|
||||
|
|
Loading…
Reference in New Issue