== FFMPEG ==

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!
This commit is contained in:
Peter Schlaile 2011-05-26 23:19:15 +00:00
parent e070975ae4
commit f1d3982bf6

@ -61,6 +61,21 @@
#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: