From 86dd087057f4300fb3ec82844697fb4ef17d2e0f Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 6 Sep 2012 03:08:47 +0000 Subject: [PATCH] fix [#32475] Enabled audio lets blender crash with autosplit option for movie output --- source/blender/blenkernel/intern/writeffmpeg.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c index 3526058e12b..cd07ac3b9ed 100644 --- a/source/blender/blenkernel/intern/writeffmpeg.c +++ b/source/blender/blenkernel/intern/writeffmpeg.c @@ -946,6 +946,7 @@ int BKE_ffmpeg_start(struct Scene *scene, RenderData *rd, int rectx, int recty, } void BKE_ffmpeg_end(void); +static void end_ffmpeg_impl(int is_autosplit); #ifdef WITH_AUDASPACE static void write_audio_frames(double to_pts) @@ -978,7 +979,7 @@ int BKE_ffmpeg_append(RenderData *rd, int start_frame, int frame, int *pixels, i if (ffmpeg_autosplit) { if (avio_tell(outfile->pb) > FFMPEG_AUTOSPLIT_SIZE) { - BKE_ffmpeg_end(); + end_ffmpeg_impl(TRUE); ffmpeg_autosplit_count++; success &= start_ffmpeg_impl(rd, rectx, recty, reports); } @@ -991,7 +992,7 @@ int BKE_ffmpeg_append(RenderData *rd, int start_frame, int frame, int *pixels, i return success; } -void BKE_ffmpeg_end(void) +static void end_ffmpeg_impl(int is_autosplit) { unsigned int i; @@ -1004,9 +1005,11 @@ void BKE_ffmpeg_end(void) #endif #ifdef WITH_AUDASPACE - if (audio_mixdown_device) { - AUD_closeReadDevice(audio_mixdown_device); - audio_mixdown_device = 0; + if (is_autosplit == FALSE) { + if (audio_mixdown_device) { + AUD_closeReadDevice(audio_mixdown_device); + audio_mixdown_device = 0; + } } #endif @@ -1069,6 +1072,11 @@ void BKE_ffmpeg_end(void) } } +void BKE_ffmpeg_end(void) +{ + end_ffmpeg_impl(FALSE); +} + /* properties */ void BKE_ffmpeg_property_del(RenderData *rd, void *type, void *prop_)