changeset 4514:790d1cb93686 libavcodec

Restore the possibility to link liba52 instead of dlopening.
author diego
date Mon, 12 Feb 2007 10:05:19 +0000
parents 3367310f8460
children a2b14c6fccfd
files Makefile a52dec.c
diffstat 2 files changed, 16 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile	Sun Feb 11 19:02:59 2007 +0000
+++ b/Makefile	Mon Feb 12 10:05:19 2007 +0000
@@ -248,7 +248,7 @@
 OBJS-$(CONFIG_ADPCM_YAMAHA_ENCODER)    += adpcm.o
 
 # external codec libraries
-OBJS-$(CONFIG_LIBA52BIN)               += a52dec.o
+OBJS-$(CONFIG_LIBA52)                  += a52dec.o
 OBJS-$(CONFIG_LIBDTS)                  += dtsdec.o
 OBJS-$(CONFIG_LIBFAAC)                 += faac.o
 OBJS-$(CONFIG_LIBFAAD)                 += faad.o
--- a/a52dec.c	Sun Feb 11 19:02:59 2007 +0000
+++ b/a52dec.c	Mon Feb 12 10:05:19 2007 +0000
@@ -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 @@
 {
     AC3DecodeState *s = avctx->priv_data;
 
+#ifdef CONFIG_LIBA52BIN
     s->handle = dlopen(liba52name, RTLD_LAZY);
     if (!s->handle)
     {
@@ -97,6 +101,15 @@
         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 @@
 {
     AC3DecodeState *s = avctx->priv_data;
     s->a52_free(s->state);
+#ifdef CONFIG_LIBA52BIN
     dlclose(s->handle);
+#endif
     return 0;
 }