changeset 5226:0d65bc05d4ac libavformat

Place MP3 demuxer code under appropriate #ifdefs. Fixes compilation with --disable-optimizations --disable-demuxers.
author diego
date Tue, 22 Sep 2009 12:39:19 +0000
parents 117ab940d1b9
children 35aaa4f2ad8d
files mp3.c
diffstat 1 files changed, 17 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/mp3.c	Tue Sep 22 11:19:36 2009 +0000
+++ b/mp3.c	Tue Sep 22 12:39:19 2009 +0000
@@ -21,12 +21,15 @@
 
 #include <strings.h>
 #include "libavutil/avstring.h"
-#include "libavcodec/mpegaudio.h"
-#include "libavcodec/mpegaudiodecheader.h"
 #include "avformat.h"
 #include "id3v2.h"
 #include "id3v1.h"
 
+#if CONFIG_MP3_DEMUXER
+
+#include "libavcodec/mpegaudio.h"
+#include "libavcodec/mpegaudiodecheader.h"
+
 /* mp3 read */
 
 static int mp3_read_probe(AVProbeData *p)
@@ -169,6 +172,18 @@
     return ret;
 }
 
+AVInputFormat mp3_demuxer = {
+    "mp3",
+    NULL_IF_CONFIG_SMALL("MPEG audio layer 2/3"),
+    0,
+    mp3_read_probe,
+    mp3_read_header,
+    mp3_read_packet,
+    .flags= AVFMT_GENERIC_INDEX,
+    .extensions = "mp2,mp3,m2a", /* XXX: use probe */
+};
+#endif
+
 #if CONFIG_MP2_MUXER || CONFIG_MP3_MUXER
 static int id3v1_set_string(AVFormatContext *s, const char *key,
                             uint8_t *buf, int buf_size)
@@ -300,18 +315,6 @@
 }
 #endif /* CONFIG_MP2_MUXER || CONFIG_MP3_MUXER */
 
-#if CONFIG_MP3_DEMUXER
-AVInputFormat mp3_demuxer = {
-    "mp3",
-    NULL_IF_CONFIG_SMALL("MPEG audio layer 2/3"),
-    0,
-    mp3_read_probe,
-    mp3_read_header,
-    mp3_read_packet,
-    .flags= AVFMT_GENERIC_INDEX,
-    .extensions = "mp2,mp3,m2a", /* XXX: use probe */
-};
-#endif
 #if CONFIG_MP2_MUXER
 AVOutputFormat mp2_muxer = {
     "mp2",