From 7bc5f2a8a438568803fdd1dc20efdd7a856f4636 Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Mon, 12 Feb 2007 10:05:19 +0000 Subject: Restore the possibility to link liba52 instead of dlopening. Originally committed as revision 7945 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/a52dec.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'libavcodec/a52dec.c') diff --git a/libavcodec/a52dec.c b/libavcodec/a52dec.c index 9f3948eb43..96cb67e51a 100644 --- a/libavcodec/a52dec.c +++ b/libavcodec/a52dec.c @@ -26,8 +26,11 @@ #include "avcodec.h" #include + +#ifdef CONFIG_LIBA52BIN #include static const char* liba52name = "liba52.so.0"; +#endif /** * liba52 - Copyright (C) Aaron Holtzman @@ -79,6 +82,7 @@ static int a52_decode_init(AVCodecContext *avctx) { AC3DecodeState *s = avctx->priv_data; +#ifdef CONFIG_LIBA52BIN s->handle = dlopen(liba52name, RTLD_LAZY); if (!s->handle) { @@ -97,6 +101,15 @@ static int a52_decode_init(AVCodecContext *avctx) dlclose(s->handle); return -1; } +#else + s->handle = 0; + s->a52_init = a52_init; + s->a52_samples = a52_samples; + s->a52_syncinfo = a52_syncinfo; + s->a52_frame = a52_frame; + s->a52_block = a52_block; + s->a52_free = a52_free; +#endif s->state = s->a52_init(0); /* later use CPU flags */ s->samples = s->a52_samples(s->state); s->inbuf_ptr = s->inbuf; @@ -226,7 +239,9 @@ static int a52_decode_end(AVCodecContext *avctx) { AC3DecodeState *s = avctx->priv_data; s->a52_free(s->state); +#ifdef CONFIG_LIBA52BIN dlclose(s->handle); +#endif return 0; } -- cgit v1.2.3