Bugfix for [#29684] Output video presets messed up
authorThomas Dinges <blender@dingto.org>
Fri, 23 Dec 2011 22:07:34 +0000 (22:07 +0000)
committerThomas Dinges <blender@dingto.org>
Fri, 23 Dec 2011 22:07:34 +0000 (22:07 +0000)
* This was caused ny the ImageType refactor.
* Problem persisted with Quicktime too, could not test that, but should fix presets there too.

source/blender/blenkernel/BKE_writeffmpeg.h
source/blender/blenkernel/intern/writeffmpeg.c
source/blender/makesrna/intern/rna_scene.c
source/blender/quicktime/apple/qtkit_export.m
source/blender/quicktime/apple/quicktime_export.c
source/blender/quicktime/quicktime_export.h

index 3263a16..257ed0b 100644 (file)
@@ -72,7 +72,7 @@ extern int append_ffmpeg(struct RenderData *rd, int frame, int *pixels, int rect
 void filepath_ffmpeg(char* string, struct RenderData* rd);
 
 extern void ffmpeg_set_preset(struct RenderData *rd, int preset);
 void filepath_ffmpeg(char* string, struct RenderData* rd);
 
 extern void ffmpeg_set_preset(struct RenderData *rd, int preset);
-extern void ffmpeg_verify_image_type(struct RenderData *rd);
+extern void ffmpeg_verify_image_type(struct RenderData *rd, struct ImageFormatData *imf);
 
 extern struct IDProperty *ffmpeg_property_add(struct RenderData *Rd, const char *type, int opt_index, int parent_index);
 extern int ffmpeg_property_add_string(struct RenderData *rd, const char *type, const char *str);
 
 extern struct IDProperty *ffmpeg_property_add(struct RenderData *Rd, const char *type, int opt_index, int parent_index);
 extern int ffmpeg_property_add_string(struct RenderData *rd, const char *type, const char *str);
index aa7d71b..bf54758 100644 (file)
@@ -1333,11 +1333,11 @@ void ffmpeg_set_preset(RenderData *rd, int preset)
        }
 }
 
        }
 }
 
-void ffmpeg_verify_image_type(RenderData *rd)
+void ffmpeg_verify_image_type(RenderData *rd, ImageFormatData *imf)
 {
        int audio= 0;
 
 {
        int audio= 0;
 
-       if(rd->imtype == R_IMF_IMTYPE_FFMPEG) {
+       if(imf->imtype == R_IMF_IMTYPE_FFMPEG) {
                if(rd->ffcodecdata.type <= 0 ||
                   rd->ffcodecdata.codec <= 0 ||
                   rd->ffcodecdata.audio_codec <= 0 ||
                if(rd->ffcodecdata.type <= 0 ||
                   rd->ffcodecdata.codec <= 0 ||
                   rd->ffcodecdata.audio_codec <= 0 ||
@@ -1353,19 +1353,19 @@ void ffmpeg_verify_image_type(RenderData *rd)
 
                audio= 1;
        }
 
                audio= 1;
        }
-       else if(rd->imtype == R_IMF_IMTYPE_H264) {
+       else if(imf->imtype == R_IMF_IMTYPE_H264) {
                if(rd->ffcodecdata.codec != CODEC_ID_H264) {
                        ffmpeg_set_preset(rd, FFMPEG_PRESET_H264);
                        audio= 1;
                }
        }
                if(rd->ffcodecdata.codec != CODEC_ID_H264) {
                        ffmpeg_set_preset(rd, FFMPEG_PRESET_H264);
                        audio= 1;
                }
        }
-       else if(rd->imtype == R_IMF_IMTYPE_XVID) {
+       else if(imf->imtype == R_IMF_IMTYPE_XVID) {
                if(rd->ffcodecdata.codec != CODEC_ID_MPEG4) {
                        ffmpeg_set_preset(rd, FFMPEG_PRESET_XVID);
                        audio= 1;
                }
        }
                if(rd->ffcodecdata.codec != CODEC_ID_MPEG4) {
                        ffmpeg_set_preset(rd, FFMPEG_PRESET_XVID);
                        audio= 1;
                }
        }
-       else if(rd->imtype == R_IMF_IMTYPE_THEORA) {
+       else if(imf->imtype == R_IMF_IMTYPE_THEORA) {
                if(rd->ffcodecdata.codec != CODEC_ID_THEORA) {
                        ffmpeg_set_preset(rd, FFMPEG_PRESET_THEORA);
                        audio= 1;
                if(rd->ffcodecdata.codec != CODEC_ID_THEORA) {
                        ffmpeg_set_preset(rd, FFMPEG_PRESET_THEORA);
                        audio= 1;
index 2a5e815..5426772 100644 (file)
@@ -659,10 +659,10 @@ static void rna_ImageFormatSettings_file_format_set(PointerRNA *ptr, int value)
                Scene *scene= ptr->id.data;
                RenderData *rd= &scene->r;
 #ifdef WITH_FFMPEG
                Scene *scene= ptr->id.data;
                RenderData *rd= &scene->r;
 #ifdef WITH_FFMPEG
-               ffmpeg_verify_image_type(rd);
+               ffmpeg_verify_image_type(rd, imf);
 #endif
 #ifdef WITH_QUICKTIME
 #endif
 #ifdef WITH_QUICKTIME
-               quicktime_verify_image_type(rd);
+               quicktime_verify_image_type(rd, imf);
 #endif
                (void)rd;
        }
 #endif
                (void)rd;
        }
index 75c7d89..8fd0402 100644 (file)
@@ -777,9 +777,9 @@ void end_qt(void)
 void free_qtcomponentdata(void) {
 }
 
 void free_qtcomponentdata(void) {
 }
 
-void quicktime_verify_image_type(RenderData *rd)
+void quicktime_verify_image_type(RenderData *rd, ImageFormatData *imf)
 {
 {
-       if (rd->im_format.imtype == R_IMF_IMTYPE_QUICKTIME) {
+       if (imf->imtype == R_IMF_IMTYPE_QUICKTIME) {
                if ((rd->qtcodecsettings.codecType<= 0) ||
                        (rd->qtcodecsettings.codecSpatialQuality <0) ||
                        (rd->qtcodecsettings.codecSpatialQuality > 100)) {
                if ((rd->qtcodecsettings.codecType<= 0) ||
                        (rd->qtcodecsettings.codecSpatialQuality <0) ||
                        (rd->qtcodecsettings.codecSpatialQuality > 100)) {
index 937e1b6..5dfce9d 100644 (file)
@@ -687,9 +687,9 @@ static void check_renderbutton_framerate(RenderData *rd, ReportList *reports)
        }
 }
 
        }
 }
 
-void quicktime_verify_image_type(RenderData *rd)
+void quicktime_verify_image_type(RenderData *rd, ImageFormatData *imf)
 {
 {
-       if (rd->im_format.imtype == R_IMF_IMTYPE_QUICKTIME) {
+       if (imf->imtype == R_IMF_IMTYPE_QUICKTIME) {
                if ((rd->qtcodecsettings.codecType== 0) ||
                        (rd->qtcodecsettings.codecSpatialQuality <0) ||
                        (rd->qtcodecsettings.codecSpatialQuality > 100)) {
                if ((rd->qtcodecsettings.codecType== 0) ||
                        (rd->qtcodecsettings.codecSpatialQuality <0) ||
                        (rd->qtcodecsettings.codecSpatialQuality > 100)) {
index 517e0c8..f64521b 100644 (file)
@@ -61,7 +61,7 @@ void end_qt(void);
 void filepath_qt(char *string, struct RenderData *rd);
 
 /*RNA helper functions */
 void filepath_qt(char *string, struct RenderData *rd);
 
 /*RNA helper functions */
-void quicktime_verify_image_type(struct RenderData *rd); //used by RNA for defaults values init, if needed
+void quicktime_verify_image_type(struct RenderData *rd, struct ImageFormatData *imf); //used by RNA for defaults values init, if needed
 /*Video codec type*/
 int quicktime_get_num_videocodecs(void);
 QuicktimeCodecTypeDesc* quicktime_get_videocodecType_desc(int indexValue);
 /*Video codec type*/
 int quicktime_get_num_videocodecs(void);
 QuicktimeCodecTypeDesc* quicktime_get_videocodecType_desc(int indexValue);