Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/blenkernel/intern/writeffmpeg.c')
-rw-r--r--source/blender/blenkernel/intern/writeffmpeg.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c
index 6010770e1ee..58a2f45e876 100644
--- a/source/blender/blenkernel/intern/writeffmpeg.c
+++ b/source/blender/blenkernel/intern/writeffmpeg.c
@@ -1,6 +1,3 @@
-/** \file blender/blenkernel/intern/writeffmpeg.c
- * \ingroup bke
- */
/*
* $Id$
*
@@ -20,6 +17,10 @@
*
*/
+/** \file blender/blenkernel/intern/writeffmpeg.c
+ * \ingroup bke
+ */
+
#ifdef WITH_FFMPEG
#include <string.h>
#include <stdio.h>
@@ -571,6 +572,11 @@ static AVStream* alloc_audio_stream(RenderData *rd, int codec_id, AVFormatContex
return NULL;
}
+ /* need to prevent floating point exception when using vorbis audio codec,
+ initialize this value in the same way as it's done in FFmpeg iteslf (sergey) */
+ st->codec->time_base.num= 1;
+ st->codec->time_base.den= st->codec->sample_rate;
+
audio_outbuf_size = FF_MIN_BUFFER_SIZE;
if((c->codec_id >= CODEC_ID_PCM_S16LE) && (c->codec_id <= CODEC_ID_PCM_DVD))
@@ -743,7 +749,11 @@ static int start_ffmpeg_impl(struct RenderData *rd, int rectx, int recty, Report
}
}
- av_write_header(of);
+ if (av_write_header(of) < 0) {
+ BKE_report(reports, RPT_ERROR, "Could not initialize streams. Probably unsupported codec combination.");
+ return 0;
+ }
+
outfile = of;
av_dump_format(of, 0, name, 1);