[FFmpeg-devel] [PATCH] ffmpeg and ffplay builds fail when libavdevice build is disabled
Georgi Chorbadzhiyski
gf
Wed Mar 3 15:32:18 CET 2010
Configuring ffmpeg (c1dacc68c32189c55683006c22bbef52f61def90 from
Wed Mar 3 10:57:38 2010 +0000) build with:
./configure --disable-avdevice
causes ffmpeg and ffplay to not build only because they call
avdevice_register_all(). Bellow are two fixes for this error.
The fixes are interchangeable.
Patch 1 - Check for libavdevice in ffmpeg and ffplay
Patch 2 - Just define avdevice_register_all() to nothing in avdevice.h
Please apply which one is better in your opinion.
--
Georgi Chorbadzhiyski
http://georgi.unixsol.org/
-------------- next part --------------
diff --git a/ffmpeg.c b/ffmpeg.c
index 4220c27..091521e 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -4021,7 +4021,9 @@ int main(int argc, char **argv)
int64_t ti;
avcodec_register_all();
+#if CONFIG_AVDEVICE
avdevice_register_all();
+#endif
av_register_all();
#if HAVE_ISATTY
diff --git a/ffplay.c b/ffplay.c
index b6b185e..196d380 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -2688,7 +2688,9 @@ int main(int argc, char **argv)
/* register all codecs, demux and protocols */
avcodec_register_all();
+#if CONFIG_AVDEVICE
avdevice_register_all();
+#endif
av_register_all();
for(i=0; i<CODEC_TYPE_NB; i++){
-------------- next part --------------
diff --git a/libavdevice/avdevice.h b/libavdevice/avdevice.h
index dcd835c..25e1177 100644
--- a/libavdevice/avdevice.h
+++ b/libavdevice/avdevice.h
@@ -52,7 +52,11 @@ const char *avdevice_license(void);
* Initialize libavdevice and register all the input and output devices.
* @warning This function is not thread safe.
*/
+#if CONFIG_AVDEVICE
void avdevice_register_all(void);
+#else
+#define avdevice_register_all(x) do { } while(0);
+#endif
#endif /* AVDEVICE_AVDEVICE_H */
More information about the ffmpeg-devel
mailing list