From f86b94f9b4623baa999961681e44b9a838834de5 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 22 Jul 2013 14:41:56 +0200 Subject: audio/decode: remove macro crap Declare decoders directly, instead of using the LIBAD_EXTERN macro. This is simpler (no weird magic) and more extensible. --- audio/decode/ad_lavc.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'audio/decode/ad_lavc.c') diff --git a/audio/decode/ad_lavc.c b/audio/decode/ad_lavc.c index 96d176eaa0..da7c5aeaad 100644 --- a/audio/decode/ad_lavc.c +++ b/audio/decode/ad_lavc.c @@ -35,15 +35,13 @@ #include "core/options.h" #include "core/av_opts.h" -#include "ad_internal.h" +#include "ad.h" #include "audio/reorder_ch.h" #include "audio/fmt-conversion.h" #include "compat/mpbswap.h" #include "compat/libav.h" -LIBAD_EXTERN(lavc) - struct priv { AVCodecContext *avctx; AVFrame *avframe; @@ -55,6 +53,9 @@ struct priv { struct demux_packet *packet; }; +static void uninit(sh_audio_t *sh); +static int decode_audio(sh_audio_t *sh,unsigned char *buffer,int minlen,int maxlen); + #define OPT_BASE_STRUCT struct MPOpts const m_option_t ad_lavc_decode_opts_conf[] = { @@ -467,3 +468,13 @@ static void add_decoders(struct mp_decoder_list *list) mp_add_decoder(list, "lavc", "pcm", "pcm", "Raw PCM"); mp_add_decoder(list, "lavc", "mp-pcm", "mp-pcm", "Raw PCM"); } + +const struct ad_functions ad_lavc = { + .name = "lavc", + .add_decoders = add_decoders, + .preinit = preinit, + .init = init, + .uninit = uninit, + .control = control, + .decode_audio = decode_audio, +}; -- cgit v1.2.3