Commit a9858917 authored by michael's avatar michael

10l bug, use av_fast_malloc() instead if av_malloc() for allocating audio

buffers.


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@20769 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent aa90ff1f
......@@ -219,6 +219,7 @@ static int64_t timer_start;
static uint8_t *audio_buf;
static uint8_t *audio_out;
unsigned int allocated_audio_out_size, allocated_audio_buf_size;
static short *samples;
......@@ -449,6 +450,7 @@ static int av_exit(int ret)
av_free(sws_opts);
av_free(audio_buf);
av_free(audio_out);
allocated_audio_buf_size= allocated_audio_out_size= 0;
av_free(samples);
if (received_sigterm) {
......@@ -579,11 +581,8 @@ static void do_audio_out(AVFormatContext *s,
av_exit(1);
}
/* SC: dynamic allocation of buffers */
if (!audio_buf)
audio_buf = av_malloc(audio_buf_size);
if (!audio_out)
audio_out = av_malloc(audio_out_size);
av_fast_malloc(&audio_buf, &allocated_audio_buf_size, audio_buf_size);
av_fast_malloc(&audio_out, &allocated_audio_out_size, audio_out_size);
if (!audio_buf || !audio_out)
return; /* Should signal an error ! */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment