From 32d5cc247fc1cf9a71492a26cebf99f9505bb82a Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Fri, 28 Feb 2014 12:23:28 +0600 Subject: Fix T38768: New "audio" button in 2.70 release does not 'mixdown' audio Issue was caused by the way how audio output works from audaspace. Now made it much closer to what's happening in ffmpeg.c and writeffmpeg.c. Also fixed issues with incompatible combinations of codecs and formats in mixdown settings. --- source/blender/editors/sound/sound_ops.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'source/blender/editors/sound') diff --git a/source/blender/editors/sound/sound_ops.c b/source/blender/editors/sound/sound_ops.c index 168693db60b..1979379032f 100644 --- a/source/blender/editors/sound/sound_ops.c +++ b/source/blender/editors/sound/sound_ops.c @@ -476,12 +476,6 @@ static void sound_mixdown_draw(bContext *C, wmOperator *op) {0, NULL, 0, NULL, NULL} }; - static EnumPropertyItem ac3_format_items[] = { - {AUD_FORMAT_S16, "S16", 0, "S16", "16 bit signed"}, - {AUD_FORMAT_FLOAT32, "F32", 0, "F32", "32 bit floating point"}, - {0, NULL, 0, NULL, NULL} - }; - #ifdef WITH_SNDFILE static EnumPropertyItem flac_format_items[] = { {AUD_FORMAT_S16, "S16", 0, "S16", "16 bit signed"}, @@ -527,10 +521,9 @@ static void sound_mixdown_draw(bContext *C, wmOperator *op) switch (container) { case AUD_CONTAINER_AC3: - RNA_def_property_clear_flag(prop_format, PROP_HIDDEN); - RNA_def_property_enum_items(prop_format, ac3_format_items); RNA_def_property_enum_items(prop_codec, all_codec_items); RNA_enum_set(op->ptr, "codec", AUD_CODEC_AC3); + RNA_enum_set(op->ptr, "format", AUD_FORMAT_FLOAT32); break; case AUD_CONTAINER_FLAC: RNA_def_property_flag(prop_bitrate, PROP_HIDDEN); @@ -539,9 +532,8 @@ static void sound_mixdown_draw(bContext *C, wmOperator *op) #ifdef WITH_SNDFILE RNA_def_property_clear_flag(prop_format, PROP_HIDDEN); RNA_def_property_enum_items(prop_format, flac_format_items); -#else - RNA_enum_set(op->ptr, "format", AUD_FORMAT_S16); #endif + RNA_enum_set(op->ptr, "format", AUD_FORMAT_S16); break; case AUD_CONTAINER_MATROSKA: RNA_def_property_clear_flag(prop_codec, PROP_HIDDEN); @@ -552,8 +544,7 @@ static void sound_mixdown_draw(bContext *C, wmOperator *op) RNA_enum_set(op->ptr, "format", AUD_FORMAT_S16); break; case AUD_CODEC_AC3: - RNA_def_property_enum_items(prop_format, ac3_format_items); - RNA_def_property_clear_flag(prop_format, PROP_HIDDEN); + RNA_enum_set(op->ptr, "format", AUD_FORMAT_FLOAT32); break; case AUD_CODEC_FLAC: RNA_def_property_flag(prop_bitrate, PROP_HIDDEN); @@ -565,6 +556,7 @@ static void sound_mixdown_draw(bContext *C, wmOperator *op) case AUD_CODEC_MP3: RNA_def_property_enum_items(prop_format, mp3_format_items); RNA_def_property_clear_flag(prop_format, PROP_HIDDEN); + RNA_enum_set(op->ptr, "format", AUD_FORMAT_S16); break; case AUD_CODEC_PCM: RNA_def_property_flag(prop_bitrate, PROP_HIDDEN); @@ -589,11 +581,13 @@ static void sound_mixdown_draw(bContext *C, wmOperator *op) RNA_def_property_enum_items(prop_format, mp3_format_items); RNA_def_property_enum_items(prop_codec, all_codec_items); RNA_enum_set(op->ptr, "codec", AUD_CODEC_MP3); + RNA_enum_set(op->ptr, "format", AUD_FORMAT_S16); break; case AUD_CONTAINER_OGG: RNA_def_property_clear_flag(prop_codec, PROP_HIDDEN); RNA_def_property_enum_items(prop_codec, ogg_codec_items); RNA_enum_set(op->ptr, "format", AUD_FORMAT_S16); + RNA_enum_set(op->ptr, "codec", AUD_CODEC_VORBIS); break; case AUD_CONTAINER_WAV: RNA_def_property_flag(prop_bitrate, PROP_HIDDEN); -- cgit v1.2.3