diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-02-17 16:08:53 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-02-17 16:10:38 +0400 |
commit | a61e3b9a9e335fdccf64fbdc942c4fd17b25646e (patch) | |
tree | b7455907caefa305fd45274089d533e5b84d22d8 /source/blender/blenkernel | |
parent | 280f9d3b398a073d7a2d64c89d5b6b69939f2f30 (diff) |
Fix T38422: Error writing AAC frame when using FFmpeg compiled with vo_aacenc
Issue was caused by missing GLOBALHEADER flag set for audio stream.
Also made it so frame is getting filled with default, that's what
happening in ffmpeg.c.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/writeffmpeg.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c index ddd6780b0e9..10d6e7c18c3 100644 --- a/source/blender/blenkernel/intern/writeffmpeg.c +++ b/source/blender/blenkernel/intern/writeffmpeg.c @@ -138,6 +138,7 @@ static int write_audio_frame(void) #ifdef FFMPEG_HAVE_ENCODE_AUDIO2 frame = avcodec_alloc_frame(); + avcodec_get_frame_defaults(frame); frame->pts = audio_time / av_q2d(c->time_base); frame->nb_samples = audio_input_samples; frame->format = c->sample_fmt; @@ -710,6 +711,10 @@ static AVStream *alloc_audio_stream(RenderData *rd, int codec_id, AVFormatContex st->codec->sample_rate = best; } + if (of->oformat->flags & AVFMT_GLOBALHEADER) { + c->flags |= CODEC_FLAG_GLOBAL_HEADER; + } + set_ffmpeg_properties(rd, c, "audio"); if (avcodec_open2(c, codec, NULL) < 0) { |