== FFMPEG ==
authorPeter Schlaile <peter@schlaile.de>
Thu, 26 May 2011 23:19:15 +0000 (23:19 +0000)
committerPeter Schlaile <peter@schlaile.de>
Thu, 26 May 2011 23:19:15 +0000 (23:19 +0000)
Added some API compatibility code again, since some API-changes weren't even documented
(they even didn't do a proper version-bump, arghh!)

If it breaks again, please tell!

source/blender/blenkernel/intern/writeffmpeg.c

index dbb4bd48629fd43e72cbb46114206d937df6d787..662763525e0b613c2f6abe292909ef0367598f3f 100644 (file)
 #include "IMB_imbuf_types.h"
 #include "IMB_imbuf.h"
 
+#if (LIBAVFORMAT_VERSION_MAJOR >= 52) && (LIBAVFORMAT_VERSION_MINOR >= 105)
+#define FFMPEG_HAVE_AVIO 1
+#endif
+
+#if (LIBAVFORMAT_VERSION_MAJOR >= 53) && (LIBAVFORMAT_VERSION_MINOR >= 3)
+#define FFMPEG_HAVE_DEFAULT_VAL_UNION 1
+#endif
+
+#ifndef FFMPEG_HAVE_AVIO
+#define AVIO_FLAG_WRITE URL_WRONLY
+#define avio_open url_fopen
+#define avio_tell url_ftell
+#define avio_close url_fclose
+#endif
+
 extern void do_init_ffmpeg(void);
 
 static int ffmpeg_type = 0;
@@ -1051,12 +1066,20 @@ IDProperty *ffmpeg_property_add(RenderData *rd, char * type, int opt_index, int
        switch (o->type) {
        case FF_OPT_TYPE_INT:
        case FF_OPT_TYPE_INT64:
+#ifdef FFMPEG_HAVE_DEFAULT_VAL_UNION
                val.i = o->default_val.i64;
+#else
+               val.i = o->default_val;
+#endif
                idp_type = IDP_INT;
                break;
        case FF_OPT_TYPE_DOUBLE:
        case FF_OPT_TYPE_FLOAT:
+#ifdef FFMPEG_HAVE_DEFAULT_VAL_UNION
                val.f = o->default_val.dbl;
+#else
+               val.f = o->default_val;
+#endif
                idp_type = IDP_FLOAT;
                break;
        case FF_OPT_TYPE_STRING: