From 5d73215a8dad922c8e383f3837f3ec9e26503389 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 11 Feb 2012 19:12:02 +0100 Subject: decoder_plugin: scan tags with callback table Pass a callback table to scan_file() and scan_stream(), instead of returning a tag object. --- src/decoder/faad_decoder_plugin.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/decoder/faad_decoder_plugin.c') 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, }; -- cgit v1.2.3