diff options
author | Diego Biurrun <diego@biurrun.de> | 2007-02-12 10:05:19 +0000 |
---|---|---|
committer | Diego Biurrun <diego@biurrun.de> | 2007-02-12 10:05:19 +0000 |
commit | 7bc5f2a8a438568803fdd1dc20efdd7a856f4636 (patch) | |
tree | f178c8b24e2d729753fdcd46ca632899b3a19ff2 /libavcodec/a52dec.c | |
parent | b5ea085b5265e35abd7bb714aaca36b359e54f99 (diff) | |
download | ffmpeg-7bc5f2a8a438568803fdd1dc20efdd7a856f4636.tar.gz |
Restore the possibility to link liba52 instead of dlopening.
Originally committed as revision 7945 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/a52dec.c')
-rw-r--r-- | libavcodec/a52dec.c | 15 |
1 files changed, 15 insertions, 0 deletions
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 <a52dec/a52.h> + +#ifdef CONFIG_LIBA52BIN #include <dlfcn.h> 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; } |