fix for [#28201] blender crashes when "mpeg" selected
authorCampbell Barton <ideasman42@gmail.com>
Wed, 10 Aug 2011 07:36:44 +0000 (07:36 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 10 Aug 2011 07:36:44 +0000 (07:36 +0000)
2 changes
- When writing OGG only allow Theora encoding, this fixes the crash.
- When setting the MPEG preset, dont allow the 'Codec' to be left as Theora, this is just confusing.

* note that this is highly confusing for users and devs - there are 4 places to set the codec/format, with both python and C presets :S.

source/blender/blenkernel/intern/writeffmpeg.c

index 4db5399..fe7a7a1 100644 (file)
@@ -658,10 +658,12 @@ static int start_ffmpeg_impl(struct RenderData *rd, int rectx, int recty, Report
        switch(ffmpeg_type) {
        case FFMPEG_AVI:
        case FFMPEG_MOV:
-       case FFMPEG_OGG:
        case FFMPEG_MKV:
                fmt->video_codec = ffmpeg_codec;
                break;
+       case FFMPEG_OGG:
+               fmt->video_codec = CODEC_ID_THEORA;
+               break;
        case FFMPEG_DV:
                fmt->video_codec = CODEC_ID_DVVIDEO;
                break;
@@ -1310,6 +1312,9 @@ void ffmpeg_verify_image_type(RenderData *rd)
                        /* Don't set preset, disturbs render resolution.
                         * ffmpeg_set_preset(rd, FFMPEG_PRESET_DVD); */
                }
+               if(rd->ffcodecdata.type == FFMPEG_OGG) {
+                       rd->ffcodecdata.type = FFMPEG_MPEG2;
+               }
 
                audio= 1;
        }