aboutsummaryrefslogtreecommitdiffstats
path: root/ffmpeg.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2003-03-20 21:32:43 +0000
committerMichael Niedermayer <michaelni@gmx.at>2003-03-20 21:32:43 +0000
commit558eae031ecf620f0baeed6049d90bf5257c90c5 (patch)
tree69c220caa4368d85e998fd8ab3561096c3976c1b /ffmpeg.c
parentd5a21172283572af587b3d939eba0091484d3263 (diff)
downloadffmpeg-558eae031ecf620f0baeed6049d90bf5257c90c5.tar.gz
10l
Originally committed as revision 1696 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'ffmpeg.c')
-rw-r--r--ffmpeg.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index 11040138d2..3d3d0c0acf 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -337,6 +337,7 @@ static void do_audio_out(AVFormatContext *s,
uint8_t *buftmp;
static uint8_t *audio_buf = NULL;
static uint8_t *audio_out = NULL;
+ const int audio_out_size= 4*MAX_AUDIO_PACKET_SIZE;
int size_out, frame_bytes, ret;
AVCodecContext *enc;
@@ -345,7 +346,7 @@ static void do_audio_out(AVFormatContext *s,
if (!audio_buf)
audio_buf = av_malloc(2*MAX_AUDIO_PACKET_SIZE);
if (!audio_out)
- audio_out = av_malloc(4*MAX_AUDIO_PACKET_SIZE);
+ audio_out = av_malloc(audio_out_size);
if (!audio_buf || !audio_out)
return; /* Should signal an error ! */
@@ -373,7 +374,7 @@ static void do_audio_out(AVFormatContext *s,
while (fifo_read(&ost->fifo, audio_buf, frame_bytes,
&ost->fifo.rptr) == 0) {
- ret = avcodec_encode_audio(enc, audio_out, sizeof(audio_out),
+ ret = avcodec_encode_audio(enc, audio_out, audio_out_size,
(short *)audio_buf);
av_write_frame(s, ost->index, audio_out, ret);
}