aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder/faad_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/faad_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 'src/decoder/faad_decoder_plugin.c')
-rw-r--r--src/decoder/faad_decoder_plugin.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/decoder/faad_decoder_plugin.c b/src/decoder/faad_decoder_plugin.c
index 91aa5392a..911f033b8 100644
--- a/src/decoder/faad_decoder_plugin.c
+++ b/src/decoder/faad_decoder_plugin.c
@@ -21,6 +21,7 @@
#include "decoder_api.h"
#include "decoder_buffer.h"
#include "audio_check.h"
+#include "tag_handler.h"
#define AAC_MAX_CHANNELS 6
@@ -487,18 +488,17 @@ faad_stream_decode(struct decoder *mpd_decoder, struct input_stream *is)
faacDecClose(decoder);
}
-static struct tag *
-faad_stream_tag(struct input_stream *is)
+static bool
+faad_scan_stream(struct input_stream *is,
+ const struct tag_handler *handler, void *handler_ctx)
{
int file_time = faad_get_file_time(is);
- struct tag *tag;
if (file_time < 0)
- return NULL;
+ return false;
- tag = tag_new();
- tag->time = file_time;
- return tag;
+ tag_handler_invoke_duration(handler, handler_ctx, file_time);
+ return true;
}
static const char *const faad_suffixes[] = { "aac", NULL };
@@ -509,7 +509,7 @@ static const char *const faad_mime_types[] = {
const struct decoder_plugin faad_decoder_plugin = {
.name = "faad",
.stream_decode = faad_stream_decode,
- .stream_tag = faad_stream_tag,
+ .scan_stream = faad_scan_stream,
.suffixes = faad_suffixes,
.mime_types = faad_mime_types,
};