aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder/dsdiff_decoder_plugin.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2012-02-11 19:12:02 +0100
committerMax Kellermann <max@duempel.org>2012-02-11 17:04:29 +0100
commit5d73215a8dad922c8e383f3837f3ec9e26503389 (patch)
tree8fc4b96d93a907054a05d3250f97bf4f68c6df85 /src/decoder/dsdiff_decoder_plugin.c
parentb7356bc526dbbd6fa00d40caff2addec10ae7c7e (diff)
downloadmpd-5d73215a8dad922c8e383f3837f3ec9e26503389.tar.gz
mpd-5d73215a8dad922c8e383f3837f3ec9e26503389.tar.xz
mpd-5d73215a8dad922c8e383f3837f3ec9e26503389.zip
decoder_plugin: scan tags with callback table
Pass a callback table to scan_file() and scan_stream(), instead of returning a tag object.
Diffstat (limited to '')
-rw-r--r--src/decoder/dsdiff_decoder_plugin.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/decoder/dsdiff_decoder_plugin.c b/src/decoder/dsdiff_decoder_plugin.c
index 47b71d8c0..391a5bf78 100644
--- a/src/decoder/dsdiff_decoder_plugin.c
+++ b/src/decoder/dsdiff_decoder_plugin.c
@@ -433,8 +433,10 @@ dsdiff_stream_decode(struct decoder *decoder, struct input_stream *is)
dsd2pcm_destroy(dsd2pcm[i]);
}
-static struct tag *
-dsdiff_stream_tag(struct input_stream *is)
+static bool
+dsdiff_scan_stream(struct input_stream *is,
+ G_GNUC_UNUSED const struct tag_handler *handler,
+ G_GNUC_UNUSED void *handler_ctx)
{
struct dsdiff_metadata metadata = {
.sample_rate = 0,
@@ -443,17 +445,17 @@ dsdiff_stream_tag(struct input_stream *is)
struct dsdiff_chunk_header chunk_header;
if (!dsdiff_read_metadata(NULL, is, &metadata, &chunk_header))
- return NULL;
+ return false;
struct audio_format audio_format;
if (!audio_format_init_checked(&audio_format, metadata.sample_rate / 8,
SAMPLE_FORMAT_S24_P32,
metadata.channels, NULL))
/* refuse to parse files which we cannot play anyway */
- return NULL;
+ return false;
/* no total time estimate, no tags implemented yet */
- return tag_new();
+ return true;
}
static const char *const dsdiff_suffixes[] = {
@@ -470,7 +472,7 @@ const struct decoder_plugin dsdiff_decoder_plugin = {
.name = "dsdiff",
.init = dsdiff_init,
.stream_decode = dsdiff_stream_decode,
- .stream_tag = dsdiff_stream_tag,
+ .scan_stream = dsdiff_scan_stream,
.suffixes = dsdiff_suffixes,
.mime_types = dsdiff_mime_types,
};