aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBaptiste Coudurier <baptiste.coudurier@gmail.com>2009-04-13 03:55:26 +0000
committerBaptiste Coudurier <baptiste.coudurier@gmail.com>2009-04-13 03:55:26 +0000
commit3321cb3f6e02954887797e67021ed48c1e108795 (patch)
tree34242966dcd8f4245c2af0c82988ac48f961d9c9
parent5973490a8f2a95766731715a87fa4379e761905a (diff)
downloadffmpeg-3321cb3f6e02954887797e67021ed48c1e108795.tar.gz
move audio buffers declarations and free them in av_exit
Originally committed as revision 18486 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--ffmpeg.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index feb1b2d760..619dda02d5 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -222,6 +222,12 @@ static unsigned int sws_flags = SWS_BICUBIC;
static int64_t timer_start;
+static uint8_t *audio_buf;
+static uint8_t *audio_out;
+static uint8_t *audio_out2;
+
+static short *samples;
+
static AVBitStreamFilterContext *video_bitstream_filters=NULL;
static AVBitStreamFilterContext *audio_bitstream_filters=NULL;
static AVBitStreamFilterContext *subtitle_bitstream_filters=NULL;
@@ -431,6 +437,10 @@ static int av_exit(int ret)
av_free(avcodec_opts[i]);
av_free(avformat_opts);
av_free(sws_opts);
+ av_free(audio_buf);
+ av_free(audio_out);
+ av_free(audio_out2);
+ av_free(samples);
if (received_sigterm) {
fprintf(stderr,
@@ -532,9 +542,6 @@ static void do_audio_out(AVFormatContext *s,
unsigned char *buf, int size)
{
uint8_t *buftmp;
- static uint8_t *audio_buf = NULL;
- static uint8_t *audio_out = NULL;
- static uint8_t *audio_out2 = NULL;
const int audio_out_size= 4*MAX_AUDIO_PACKET_SIZE;
int size_out, frame_bytes, ret;
@@ -1185,7 +1192,6 @@ static int output_packet(AVInputStream *ist, int ist_index,
AVFrame picture;
void *buffer_to_free;
static unsigned int samples_size= 0;
- static short *samples= NULL;
AVSubtitle subtitle, *subtitle_to_free;
int got_subtitle;
AVPacket avpkt;