Revision: 44408
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=44408
Author:   nazgul
Date:     2012-02-24 15:34:57 +0000 (Fri, 24 Feb 2012)
Log Message:
-----------
Blender should now compile fine with older FFmpeg libraries used.

Modified Paths:
--------------
    trunk/blender/intern/ffmpeg/ffmpeg_compat.h
    trunk/blender/source/blender/blenkernel/intern/writeffmpeg.c

Modified: trunk/blender/intern/ffmpeg/ffmpeg_compat.h
===================================================================
--- trunk/blender/intern/ffmpeg/ffmpeg_compat.h 2012-02-24 14:03:18 UTC (rev 
44407)
+++ trunk/blender/intern/ffmpeg/ffmpeg_compat.h 2012-02-24 15:34:57 UTC (rev 
44408)
@@ -72,6 +72,10 @@
 #define FFMPEG_SWSCALE_COLOR_SPACE_SUPPORT
 #endif
 
+#if ((LIBAVUTIL_VERSION_MAJOR > 51) || (LIBAVUTIL_VERSION_MAJOR == 51) && 
(LIBAVUTIL_VERSION_MINOR >= 32))
+#define FFMPEG_FFV1_ALPHA_SUPPORTED
+#endif
+
 #ifndef FFMPEG_HAVE_AVIO
 #define AVIO_FLAG_WRITE URL_WRONLY
 #define avio_open url_fopen

Modified: trunk/blender/source/blender/blenkernel/intern/writeffmpeg.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/writeffmpeg.c        
2012-02-24 14:03:18 UTC (rev 44407)
+++ trunk/blender/source/blender/blenkernel/intern/writeffmpeg.c        
2012-02-24 15:34:57 UTC (rev 44408)
@@ -512,12 +512,16 @@
        }
 
        if (codec_id == CODEC_ID_FFV1) {
+#ifdef FFMPEG_FFV1_ALPHA_SUPPORTED
                if (rd->im_format.planes ==  R_IMF_PLANES_RGBA) {
                        c->pix_fmt = PIX_FMT_RGB32;
                }
                else {
                        c->pix_fmt = PIX_FMT_BGR0;
                }
+#else
+               c->pix_fmt = PIX_FMT_RGB32;
+#endif
        }
 
        if (codec_id == CODEC_ID_QTRLE ) {
@@ -1435,7 +1439,15 @@
 {
        int codec = rd->ffcodecdata.codec;
 
-       return ELEM(codec, CODEC_ID_QTRLE, CODEC_ID_FFV1);
+       if (codec == CODEC_ID_QTRLE)
+               return TRUE;
+
+#ifdef FFMPEG_FFV1_ALPHA_SUPPORTED
+       if (codec == CODEC_ID_FFV1)
+               return TRUE;
+#endif
+
+       return FALSE;
 }
 
 #endif

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to