]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/a52dec.c
vc1_split should be static
[ffmpeg] / libavcodec / a52dec.c
index 9f3948eb43b6b4bc379b0f1fd85ec49a1c1c3229..c2da2283d9d8ed0569fd316efd32996f12c7820a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * A52 decoder
+ * A52 decoder using liba52
  * Copyright (c) 2001 Fabrice Bellard.
  *
  * This file is part of FFmpeg.
 
 /**
  * @file a52dec.c
- * A52 decoder.
+ * A52 decoder using liba52
  */
 
 #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
@@ -67,6 +70,7 @@ typedef struct AC3DecodeState {
 
 } AC3DecodeState;
 
+#ifdef CONFIG_LIBA52BIN
 static void* dlsymm(void* handle, const char* symbol)
 {
     void* f = dlsym(handle, symbol);
@@ -74,11 +78,13 @@ static void* dlsymm(void* handle, const char* symbol)
         av_log( NULL, AV_LOG_ERROR, "A52 Decoder - function '%s' can't be resolved\n", symbol);
     return f;
 }
+#endif
 
 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 +103,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 +241,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;
 }