]> git.sesse.net Git - vlc/commitdiff
Detect and allow older versions of ffmpeg to be used in conjunction with VLC.
authorFaustino Osuna <riquedafreak@videolan.org>
Fri, 29 Feb 2008 00:46:50 +0000 (00:46 +0000)
committerFaustino Osuna <riquedafreak@videolan.org>
Fri, 29 Feb 2008 00:46:50 +0000 (00:46 +0000)
16 files changed:
configure.ac
extras/buildsystem/cmake/config.h.cmake
extras/buildsystem/cmake/include/config.cmake
modules/codec/ffmpeg/audio.c
modules/codec/ffmpeg/chroma.c
modules/codec/ffmpeg/deinterlace.c
modules/codec/ffmpeg/demux.c
modules/codec/ffmpeg/encoder.c
modules/codec/ffmpeg/ffmpeg.c
modules/codec/ffmpeg/mux.c
modules/codec/ffmpeg/postprocess.c
modules/codec/ffmpeg/scale.c
modules/codec/ffmpeg/video.c
modules/codec/ffmpeg/video_filter.c
modules/codec/zvbi.c
modules/stream_out/switcher.c

index 6d6d0aab2312917d1c6b86110406989d3e30d405..5f361169267b9d494a35d1452e0193be4ae13c9a 100644 (file)
@@ -3058,9 +3058,10 @@ dnl Trying with pkg-config
      VLC_SAVE_FLAGS
      CPPFLAGS="${CPPFLAGS} ${FFMPEG_CFLAGS}"
      CFLAGS="${CFLAGS} ${FFMPEG_CFLAGS}"
-     AC_CHECK_HEADERS(libavcodec/avcodec.h, [], [AC_MSG_ERROR([Missing header file libavcodec/avcodec.h.])] )
-     AC_CHECK_HEADERS(libavformat/avformat.h, [], [AC_MSG_ERROR([Missing header file libavformat/avformat.h.])] )
-     AC_CHECK_HEADERS(libavutil/avutil.h, [], [AC_MSG_ERROR([Missing header file libavutil/avutil.h.])] )
+     AC_CHECK_HEADERS(libavcodec/avcodec.h ffmpeg/avcodec.h)
+     AC_CHECK_HEADERS(libavformat/avformat.h ffmpeg/avformat.h)
+     AC_CHECK_HEADERS(libavutil/avutil.h ffmpeg/avformat.h)
+     
      dnl newer ffmpeg have a separate libpostproc
      PKG_CHECK_MODULES(POSTPROC, libpostproc,[
        VLC_ADD_CFLAGS([ffmpeg],[${POSTPROC_CFLAGS}]) 
@@ -3068,7 +3069,7 @@ dnl Trying with pkg-config
        ],[ true ])
      CPPFLAGS="${CPPFLAGS} ${POSTPROC_CFLAGS}"
      CFLAGS="${CFLAGS} ${POSTPROC_CFLAGS}"
-     AC_CHECK_HEADERS(libpostproc/postprocess.h, [], [AC_MSG_ERROR([Missing header file libpostproc/postprocess.h.])] )
+     AC_CHECK_HEADERS(postproc/postprocess.h)
      if test "${SYS}" = "darwin"; then
         VLC_ADD_BUILTINS([ffmpeg])
      else
@@ -3089,7 +3090,7 @@ dnl Trying with pkg-config
        VLC_ADD_CFLAGS([ffmpeg],[${SWSCALE_CFLAGS}])
        VLC_ADD_LIBS([ffmpeg],[${SWSCALE_LIBS}])
        AC_CHECK_LIB(swscale, sws_getContext,
-         [AC_CHECK_HEADERS([libavutil/avutil.h libswscale/swscale.h])],[],[-lavutil -lm])
+         [AC_CHECK_HEADERS([ffmpeg/avutil.h libavutil/avutil.h ffmpeg/swscale.h libswscale/swscale.h])],[],[-lavutil -lm])
        ],[ true ])
      VLC_RESTORE_FLAGS
     ],[
@@ -3099,10 +3100,10 @@ dnl Trying with pkg-config
     dnl
       CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_ffmpeg}"
       LDFLAGS="${LDFLAGS_save} ${LDFLAGS_ffmpeg} ${LIBS_ffmpeg}"
-      AC_CHECK_HEADERS(libavcodec/avcodec.h, [], [AC_MSG_ERROR([Missing header file libavcodec/avcodec.h.])] )
-      AC_CHECK_HEADERS(libavformat/avformat.h)
-      AC_CHECK_HEADERS(libavutil/avutil.h)
-      AC_CHECK_HEADERS(libpostproc/postprocess.h, [], [AC_MSG_ERROR([Missing header file libpostproc/postprocess.h.])] )
+      AC_CHECK_HEADERS(libavcodec/avcodec.h ffmpeg/avcodec.h)
+      AC_CHECK_HEADERS(libavformat/avformat.h ffmpeg/avformat.h)
+      AC_CHECK_HEADERS(libavutil/avutil.h ffmpeg/avutil.h)
+      AC_CHECK_HEADERS(postproc/postprocess.h)
 
       AC_CHECK_LIB(avutil, av_crc_init, [
         VLC_ADD_LIBS([ffmpeg],[-lavutil])
@@ -3127,11 +3128,24 @@ dnl Trying with pkg-config
       CPPFLAGS="${CPPFLAGS_save}"
 
       AC_CHECK_LIB(swscale, sws_getContext, [
-        AC_CHECK_HEADERS(libswscale/swscale.h)
+        AC_CHECK_HEADERS(libswscale/swscale.h ffmpeg/swscale.h)
         VLC_ADD_LIBS([ffmpeg],[-lswscale]) ], [], [-lavcodec $LDAVUTIL])
       LDFLAGS="${LDFLAGS_save}"
       CPPFLAGS="${CPPFLAGS_save}"
     ])
+    
+    if test "$ac_cv_header_libavcodec_avcodec_h" = "no" && test "$ac_cv_header_ffmpeg_avcodec_h" = "no"; then
+        AC_MSG_ERROR([Missing header file libavcodec/avcodec.h.])
+    fi
+    if test "$ac_cv_header_libavformat_avformat_h" = "no" && test $"ac_cv_header_ffmpeg_avformat_h" = "no"; then
+        AC_MSG_ERROR([Missing header file libavformat/avformat.h.])
+    fi
+    if test "$ac_cv_header_libavutil_avutil_h" = "no" && test "$ac_cv_header_ffmpeg_avutil_h" = "no"; then
+        AC_MSG_ERROR([Missing header file libavutil/avutil.h.])
+    fi
+    if test "$ac_cv_header_libswscale_swscale_h" = "no" && test "$ac_cv_header_ffmpeg_swscale_h" = "no"; then
+        AC_MSG_ERROR([Missing header file libswscale/swscale.h.])
+    fi
   fi
 fi
 
index e75b3c6e8be77e0154f60706b6311acbf838f9cc..b60c9c7af468266b857cf57fd7b06f702f1f2fc6 100644 (file)
 #cmakedefine HAVE_ERRNO_H
 #cmakedefine HAVE_FAAD_H
 #cmakedefine HAVE_FCNTL_H
+#cmakedefine HAVE_FFMPEG_AVCODEC_H 
+#cmakedefine HAVE_FFMPEG_AVFORMAT_H 
+#cmakedefine HAVE_FFMPEG_AVUTIL_H 
+#cmakedefine HAVE_FFMPEG_SWSCALE_H
 #cmakedefine HAVE_LIBAVCODEC_AVCODEC_H
 #cmakedefine HAVE_LIBAVFORMAT_AVFORMAT_H
 #cmakedefine HAVE_LIBAVUTIL_AVUTIL_H
index 37cbfeca0bb498b88721a9ac59469f7351729c4c..e458c6fe27d88cb718e2a99af998195fb556e8e7 100644 (file)
@@ -451,9 +451,9 @@ if(FFmpeg_FOUND)
   set( CMAKE_REQUIRED_FLAGS_saved ${CMAKE_REQUIRED_FLAGS} )
   set( CMAKE_REQUIRED_FLAGS ${FFmpeg_CFLAGS} )
 
-  vlc_check_include_files (libavcodec/avcodec.h)
-  vlc_check_include_files (libavutil/avutil.h)
-  vlc_check_include_files (libswscale/swscale.h)
+  vlc_check_include_files (libavcodec/avcodec.h ffmpeg/avcodec.h)
+  vlc_check_include_files (libavutil/avutil.h ffmpeg/avutil.h)
+  vlc_check_include_files (libswscale/swscale.h ffmpeg/swscale.h)
   
   check_include_files ("stdint.h;postproc/postprocess.h" HAVE_POSTPROC_POSTPROCESS_H)
   vlc_enable_modules(ffmpeg)
index a4da9fec6b52bb8133cb5bfb9998b4bc7ceedffd..f8274e5b3043c47c5e24c87dde7a14204268e794 100644 (file)
 #include <vlc_input.h>
 
 /* ffmpeg header */
-#ifdef HAVE_LIBAVCODEC_AVCODEC_H
+#if defined(HAVE_LIBAVCODEC_AVCODEC_H)
 #   include <libavcodec/avcodec.h>
+#elif defined(HAVE_FFMPEG_AVCODEC_H)
+#   include <ffmpeg/avcodec.h>
 #else
 #   include <avcodec.h>
 #endif
index 9104c5af64ce32289d9d2bbf3d3887dddc56e98c..50b16bcf6b2022cf9e454f74ec536ef94b4ed413 100644 (file)
 #include <vlc/vlc.h>
 #include <vlc_vout.h>
 
-#if defined(HAVE_LIBSWSCALE_SWSCALE_H) || defined(HAVE_LIBSWSCALE_TREE)
+#if defined(HAVE_LIBSWSCALE_SWSCALE_H) || defined(HAVE_FFMPEG_SWSCALE_H) || defined(HAVE_LIBSWSCALE_TREE)
 #include <vlc_filter.h>
 #endif
 
 /* ffmpeg header */
-#ifdef HAVE_LIBAVCODEC_AVCODEC_H
+#if defined(HAVE_LIBAVCODEC_AVCODEC_H)
 #   include <libavcodec/avcodec.h>
+#elif defined(HAVE_FFMPEG_AVCODEC_H)
+#   include <ffmpeg/avcodec.h>
 #else
 #   include <avcodec.h>
 #endif
 
 #include "ffmpeg.h"
 
-#if !defined(HAVE_LIBSWSCALE_SWSCALE_H) && !defined(HAVE_LIBSWSCALE_TREE)
+#if !defined(HAVE_LIBSWSCALE_SWSCALE_H) && !defined(HAVE_FFMPEG_SWSCALE_H) && !defined(HAVE_LIBSWSCALE_TREE)
 void E_(InitLibavcodec) ( vlc_object_t *p_object );
 static void ChromaConversion( vout_thread_t *, picture_t *, picture_t * );
 
@@ -361,4 +363,4 @@ void E_(CloseChroma)( vlc_object_t *p_this )
     free( p_vout->chroma.p_sys );
 }
 
-#endif /* !defined(HAVE_LIBSWSCALE_SWSCALE_H) && !defined(HAVE_LIBSWSCALE_TREE) */
+#endif /* !defined(HAVE_LIBSWSCALE_SWSCALE_H) && !defined(HAVE_FFMPEG_SWSCALE_H) && !defined(HAVE_LIBSWSCALE_TREE) */
index 1739a754e58b18cf85832695bfa6edcb53452100..29145a3dc43dab47dc7db5c5cd048256ae3c58c1 100644 (file)
 #include <vlc_filter.h>
 
 /* ffmpeg header */
-#ifdef HAVE_LIBAVCODEC_AVCODEC_H
+#if defined(HAVE_LIBAVCODEC_AVCODEC_H)
 #   include <libavcodec/avcodec.h>
+#elif defined(HAVE_FFMPEG_AVCODEC_H)
+#   include <ffmpeg/avcodec.h>
 #else
 #   include <avcodec.h>
 #endif
index 5750f4c9eb8a1769880b6c4d0a48634ddab23ca1..becc7b2fab84c4b805fbba653ff10d6537da2cd9 100644 (file)
 #include <vlc_meta.h>
 
 /* ffmpeg header */
-#ifdef HAVE_LIBAVFORMAT_AVFORMAT_H
+#if defined(HAVE_LIBAVFORMAT_AVFORMAT_H)
 #   include <libavformat/avformat.h>
+#elif defined(HAVE_FFMPEG_AVFORMAT_H)
+#   include <ffmpeg/avformat.h>
 #elif defined(HAVE_LIBAVFORMAT_TREE)
 #   include <avformat.h>
 #endif
@@ -47,7 +49,7 @@
 //#define AVFORMAT_DEBUG 1
 
 /* Version checking */
-#if defined(HAVE_LIBAVFORMAT_AVFORMAT_H) || defined(HAVE_LIBAVFORMAT_TREE)
+#if defined(HAVE_LIBSWSCALE_SWSCALE_H) || defined(HAVE_FFMPEG_SWSCALE_H) || defined(HAVE_LIBSWSCALE_TREE)
 
 /*****************************************************************************
  * demux_sys_t: demux descriptor
index 1d5c0c258bf225199e98048eac2ac50ea6b6b84b..a042152541a9a7459156039087bbc836e204511a 100644 (file)
 
 /* ffmpeg header */
 #define HAVE_MMX 1
-#ifdef HAVE_LIBAVCODEC_AVCODEC_H
+#if defined(HAVE_LIBAVCODEC_AVCODEC_H)
 #   include <libavcodec/avcodec.h>
+#elif defined(HAVE_FFMPEG_AVCODEC_H)
+#   include <ffmpeg/avcodec.h>
 #else
 #   include <avcodec.h>
 #endif
index bd5046524fede8c760683ad7240419b9ea6ed2d5..66a40a7739259e3622cbd057b04161934a226dc6 100644 (file)
 
 /* ffmpeg header */
 #define HAVE_MMX 1
-#ifdef HAVE_LIBAVCODEC_AVCODEC_H
+#if defined(HAVE_LIBAVCODEC_AVCODEC_H)
 #   include <libavcodec/avcodec.h>
+#elif defined(HAVE_FFMPEG_AVCODEC_H)
+#   include <ffmpeg/avcodec.h>
 #else
 #   include <avcodec.h>
 #endif
@@ -74,7 +76,7 @@ static const char *nloopf_list_text[] =
 static const char *enc_hq_list[] = { "rd", "bits", "simple" };
 static const char *enc_hq_list_text[] = { N_("rd"), N_("bits"), N_("simple") };
 
-#if defined(HAVE_LIBSWSCALE_SWSCALE_H) || defined(HAVE_LIBSWSCALE_TREE)
+#if defined(HAVE_LIBSWSCALE_SWSCALE_H) || defined(HAVE_FFMPEG_SWSCALE_H) || defined(HAVE_LIBSWSCALE_TREE)
 static int pi_mode_values[] = { 0, 1, 2, 4, 8, 5, 6, 9, 10 };
 static const char *ppsz_mode_descriptions[] =
 { N_("Fast bilinear"), N_("Bilinear"), N_("Bicubic (good quality)"),
@@ -196,7 +198,7 @@ vlc_module_begin();
     add_integer( ENC_CFG_PREFIX "chroma-elim-threshold", 0, NULL,
                  ENC_CHROMA_ELIM_TEXT, ENC_CHROMA_ELIM_LONGTEXT, VLC_TRUE );
 
-#if defined(HAVE_LIBAVFORMAT_AVFORMAT_H) || defined(HAVE_LIBAVFORMAT_TREE)
+#if defined(HAVE_LIBSWSCALE_SWSCALE_H) || defined(HAVE_FFMPEG_SWSCALE_H) || defined(HAVE_LIBSWSCALE_TREE)
     /* demux submodule */
     add_submodule();
     set_description( _("FFmpeg demuxer" ) );
@@ -212,7 +214,7 @@ vlc_module_begin();
     set_callbacks( E_(OpenMux), E_(CloseMux) );
 #endif
 
-#if defined(HAVE_LIBSWSCALE_SWSCALE_H) || defined(HAVE_LIBSWSCALE_TREE)
+#if defined(HAVE_LIBSWSCALE_SWSCALE_H) || defined(HAVE_FFMPEG_SWSCALE_H) || defined(HAVE_LIBSWSCALE_TREE)
     /* video filter submodule */
     add_submodule();
     set_description( _("Video scaling filter") );
index aebe91e6c582023a165e46ee485749ba25e418fa..975921c10c6afd241f069f322af5981d053ceba3 100644 (file)
@@ -45,7 +45,7 @@
 //#define AVFORMAT_DEBUG 1
 
 /* Version checking */
-#if defined(HAVE_LIBAVFORMAT_AVFORMAT_H) || defined(HAVE_LIBAVFORMAT_TREE)
+#if defined(HAVE_LIBSWSCALE_SWSCALE_H) || defined(HAVE_FFMPEG_SWSCALE_H) || defined(HAVE_LIBSWSCALE_TREE)
 
 static const char *ppsz_mux_options[] = {
     "mux", NULL
index 293515ec6dd344dfd1037b126a6edb80cb5c18a1..3a4dd9af762d3ba610ce644db63dfd86fb920e62 100644 (file)
 #include <vlc_codec.h>
 
 /* ffmpeg header */
-#ifdef HAVE_LIBAVCODEC_AVCODEC_H
+#if defined(HAVE_LIBAVCODEC_AVCODEC_H)
 #   include <libavcodec/avcodec.h>
+#elif defined(HAVE_FFMPEG_AVCODEC_H)
+#   include <ffmpeg/avcodec.h>
 #else
 #   include <avcodec.h>
 #endif
index 3d07288e551974e06ea314d82837caaa2b0585f1..1a2adb5f71a5fd2d8ca9ccfce4accc73196ad8d4 100644 (file)
 #include <vlc_filter.h>
 
 /* ffmpeg headers */
-#ifdef HAVE_LIBAVCODEC_AVCODEC_H
+#if defined(HAVE_LIBAVCODEC_AVCODEC_H)
 #   include <libavcodec/avcodec.h>
+#elif defined(HAVE_FFMPEG_AVCODEC_H)
+#   include <ffmpeg/avcodec.h>
 #else
 #   include <avcodec.h>
 #endif
 
-#ifdef HAVE_LIBSWSCALE_SWSCALE_H
+#if defined(HAVE_LIBSWSCALE_SWSCALE_H)
 #   include <libswscale/swscale.h>
+#elif defined(HAVE_FFMPEG_H)
+#   include <ffmpeg/swscale.h>
 #elif defined(HAVE_LIBSWSCALE_TREE)
 #   include <swscale.h>
 #endif
@@ -49,7 +53,7 @@
 #include "ffmpeg.h"
 
 /* Version checking */
-#if ( (defined(HAVE_LIBSWSCALE_SWSCALE_H) || defined(HAVE_LIBSWSCALE_TREE)) && (LIBSWSCALE_VERSION_INT >= ((0<<16)+(5<<8)+0)) )
+#if ( (defined(HAVE_LIBSWSCALE_SWSCALE_H) || defined(HAVE_FFMPEG_SWSCALE_H) || defined(HAVE_LIBSWSCALE_TREE)) && (LIBSWSCALE_VERSION_INT >= ((0<<16)+(5<<8)+0)) )
 
 /*****************************************************************************
  * filter_sys_t : filter descriptor
index 2ec7993b6846b08114abaf7e8b1821645770e119..bce47a94d0d5457e0c69bc9358f51833ec1e1e30 100644 (file)
 #include <vlc_input.h>                  /* hmmm, just for INPUT_RATE_DEFAULT */
 
 /* ffmpeg header */
-#ifdef HAVE_LIBAVCODEC_AVCODEC_H
+#if defined(HAVE_LIBAVCODEC_AVCODEC_H)
 #   include <libavcodec/avcodec.h>
+#elif defined(HAVE_FFMPEG_AVCODEC_H)
+#   include <ffmpeg/avcodec.h>
 #else
 #   include <avcodec.h>
 #endif
@@ -843,7 +845,7 @@ static void ffmpeg_CopyPicture( decoder_t *p_dec,
                 dest_pic.data[i] = p_pic->p[i].p_pixels;
                 dest_pic.linesize[i] = p_pic->p[i].i_pitch;
             }
-#if !defined(HAVE_LIBSWSCALE_SWSCALE_H) && !defined(HAVE_LIBSWSCALE_TREE)
+#if !defined(HAVE_LIBSWSCALE_SWSCALE_H) && !defined(HAVE_FFMPEG_SWSCALE_H) && !defined(HAVE_LIBSWSCALE_TREE)
             img_convert( &dest_pic, PIX_FMT_YUV420P,
                          (AVPicture *)p_ff_pic,
                          p_sys->p_context->pix_fmt,
index 6f5235d1d8296696258893df256aa61c14fe47e7..9af221640f5f8fcafdf6d829fe66b6902ec53f93 100644 (file)
 #include <vlc_filter.h>
 
 /* ffmpeg header */
-#ifdef HAVE_LIBAVCODEC_AVCODEC_H
+#if defined(HAVE_LIBAVCODEC_AVCODEC_H)
 #   include <libavcodec/avcodec.h>
+#elif defined(HAVE_FFMPEG_AVCODEC_H)
+#   include <ffmpeg/avcodec.h>
 #else
 #   include <avcodec.h>
 #endif
 
 #include "ffmpeg.h"
 
-#if !defined(HAVE_LIBSWSCALE_SWSCALE_H) && !defined(HAVE_LIBSWSCALE_TREE)
+#if !defined(HAVE_LIBSWSCALE_SWSCALE_H) && !defined(HAVE_FFMPEG_SWSCALE_H) && !defined(HAVE_LIBSWSCALE_TREE)
 void E_(InitLibavcodec) ( vlc_object_t *p_object );
 static int CheckInit( filter_t *p_filter );
 static picture_t *Process( filter_t *p_filter, picture_t *p_pic );
@@ -566,4 +568,4 @@ static picture_t *Process( filter_t *p_filter, picture_t *p_pic )
     p_pic->pf_release( p_pic );
     return p_pic_dst;
 }
-#endif /* ( (defined(HAVE_LIBSWSCALE_SWSCALE_H) || defined(HAVE_LIBSWSCALE_TREE)) */
+#endif /* ( (defined(HAVE_LIBSWSCALE_SWSCALE_H) || defined(HAVE_FFMPEG_SWSCALE_H) || defined(HAVE_LIBSWSCALE_TREE)) */
index 6fbb4f047b7e34d9a8d81f4d01d73e6bc68f69a0..e3cabe44e5e059e6985ccbcb1c87d78f15b1db3c 100644 (file)
@@ -136,7 +136,7 @@ struct decoder_sys_t
     int                     i_align;
 
     /* Misc */
-#ifdef HAVE_LIBSWSCALE_SWSCALE_H
+#if defined(HAVE_LIBSWSCALE_SWSCALE_H) || defined(HAVE_FFMPEG_SWSCALE_H)
     image_handler_t         *p_image;
 #endif
 };
@@ -181,7 +181,7 @@ static int Open( vlc_object_t *p_this )
     }
     memset( p_sys, 0, sizeof(decoder_sys_t) );
 
-#ifdef HAVE_LIBSWSCALE_SWSCALE_H
+#if defined(HAVE_LIBSWSCALE_SWSCALE_H) || defined(HAVE_FFMPEG_SWSCALE_H)
     p_sys->p_image = image_HandlerCreate( VLC_OBJECT(p_dec) );
     if( !p_sys->p_image )
     {
@@ -225,7 +225,7 @@ static int Open( vlc_object_t *p_this )
     if( p_sys->b_text )
         p_dec->fmt_out.video.i_chroma = VLC_FOURCC('T','E','X','T');
     else
-#ifdef HAVE_LIBSWSCALE_SWSCALE_H
+#if defined(HAVE_LIBSWSCALE_SWSCALE_H) || defined(HAVE_FFMPEG_SWSCALE_H)
         p_dec->fmt_out.video.i_chroma = VLC_FOURCC('Y','U','V','A');
 #else
         p_dec->fmt_out.video.i_chroma = VLC_FOURCC('R','G','B','A');
@@ -246,7 +246,7 @@ static void Close( vlc_object_t *p_this )
     var_DelCallback( p_dec, "vbi-page", RequestPage, p_sys );
     var_DelCallback( p_dec, "vbi-opaque", Opaque, p_sys );
 
-#ifdef HAVE_LIBSWSCALE_SWSCALE_H
+#if defined(HAVE_LIBSWSCALE_SWSCALE_H) || defined(HAVE_FFMPEG_SWSCALE_H)
     if( p_sys->p_image ) image_HandlerDelete( p_sys->p_image );
 #endif
     if( p_sys->p_vbi_dec ) vbi_decoder_delete( p_sys->p_vbi_dec );
@@ -323,7 +323,7 @@ static subpicture_t *Decode( decoder_t *p_dec, block_t **pp_block )
     /* Create a new subpicture region */
     memset( &fmt, 0, sizeof(video_format_t) );
     fmt.i_chroma = p_sys->b_text ? VLC_FOURCC('T','E','X','T') :
-#ifdef HAVE_LIBSWSCALE_SWSCALE_H
+#if defined(HAVE_LIBSWSCALE_SWSCALE_H) || defined(HAVE_FFMPEG_SWSCALE_H)
                                    VLC_FOURCC('Y','U','V','A');
 #else
                                    VLC_FOURCC('R','G','B','A');
@@ -383,7 +383,7 @@ static subpicture_t *Decode( decoder_t *p_dec, block_t **pp_block )
     }
     else
     {
-#ifdef HAVE_LIBSWSCALE_SWSCALE_H
+#if defined(HAVE_LIBSWSCALE_SWSCALE_H) || defined(HAVE_FFMPEG_SWSCALE_H)
         video_format_t fmt_in;
         picture_t *p_pic, *p_dest;
 
index 538892643f7281c0701731e49e2c675062e549f8..7dd51c7eae7bf725beae8342496c144db057a601 100644 (file)
@@ -38,7 +38,9 @@
 #include <vlc_network.h>
 
 #define HAVE_MMX
-#ifdef HAVE_LIBAVCODEC_AVCODEC_H
+#if defined(HAVE_LIBAVCODEC_AVCODEC_H)
+#   include <libavcodec/avcodec.h>
+#elif defined(HAVE_FFMPEG_AVCODEC_H)
 #   include <ffmpeg/avcodec.h>
 #else
 #   include <avcodec.h>