diff options
author | wm4 <wm4@nowhere> | 2013-07-22 14:41:56 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-07-22 14:41:56 +0200 |
commit | f86b94f9b4623baa999961681e44b9a838834de5 (patch) | |
tree | e06a91d29b16b735d0235acaa56a59a14e522c4b /audio/decode/ad_lavc.c | |
parent | 0b160e125723baa42aa3e880945817e518946bd2 (diff) | |
download | mpv-f86b94f9b4623baa999961681e44b9a838834de5.tar.bz2 mpv-f86b94f9b4623baa999961681e44b9a838834de5.tar.xz |
audio/decode: remove macro crap
Declare decoders directly, instead of using the LIBAD_EXTERN macro. This
is simpler (no weird magic) and more extensible.
Diffstat (limited to 'audio/decode/ad_lavc.c')
-rw-r--r-- | audio/decode/ad_lavc.c | 17 |
1 files changed, 14 insertions, 3 deletions
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, +}; |