aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAurelien Jacobs <aurel@gnuage.org>2010-10-01 21:54:20 +0000
committerAurelien Jacobs <aurel@gnuage.org>2010-10-01 21:54:20 +0000
commit620a67d56ae5e31fdc1ddeb694c23889061ae522 (patch)
treec689322ee72732bf1448834c0b02c8baa78458d5
parent3a8e882419920455cbd5d75af1d0d5d16aa7ddb9 (diff)
downloadffmpeg-620a67d56ae5e31fdc1ddeb694c23889061ae522.tar.gz
ffmpeg: dynamically allocate bitstream_filters
Originally committed as revision 25303 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--ffmpeg.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index 666d0967b7..bdd7f3ef54 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -244,7 +244,8 @@ static short *samples;
static AVBitStreamFilterContext *video_bitstream_filters=NULL;
static AVBitStreamFilterContext *audio_bitstream_filters=NULL;
static AVBitStreamFilterContext *subtitle_bitstream_filters=NULL;
-static AVBitStreamFilterContext *bitstream_filters[MAX_FILES][MAX_STREAMS];
+static AVBitStreamFilterContext **bitstream_filters[MAX_FILES] = {NULL};
+static int nb_bitstream_filters[MAX_FILES] = {0};
#define DEFAULT_PASS_LOGFILENAME_PREFIX "ffmpeg2pass"
@@ -606,6 +607,7 @@ static int ffmpeg_exit(int ret)
}
av_metadata_free(&s->metadata);
av_free(s);
+ av_free(bitstream_filters[i]);
}
for(i=0;i<nb_input_files;i++) {
av_close_input_file(input_files[i]);
@@ -3413,6 +3415,7 @@ static void new_video_stream(AVFormatContext *oc)
}
avcodec_get_context_defaults3(st->codec, codec);
+ bitstream_filters[nb_output_files] = grow_array(bitstream_filters[nb_output_files], sizeof(*bitstream_filters[nb_output_files]), &nb_bitstream_filters[nb_output_files], oc->nb_streams);
bitstream_filters[nb_output_files][oc->nb_streams - 1]= video_bitstream_filters;
video_bitstream_filters= NULL;
@@ -3554,6 +3557,7 @@ static void new_audio_stream(AVFormatContext *oc)
avcodec_get_context_defaults3(st->codec, codec);
+ bitstream_filters[nb_output_files] = grow_array(bitstream_filters[nb_output_files], sizeof(*bitstream_filters[nb_output_files]), &nb_bitstream_filters[nb_output_files], oc->nb_streams);
bitstream_filters[nb_output_files][oc->nb_streams - 1]= audio_bitstream_filters;
audio_bitstream_filters= NULL;
@@ -3622,6 +3626,7 @@ static void new_subtitle_stream(AVFormatContext *oc)
}
avcodec_get_context_defaults3(st->codec, codec);
+ bitstream_filters[nb_output_files] = grow_array(bitstream_filters[nb_output_files], sizeof(*bitstream_filters[nb_output_files]), &nb_bitstream_filters[nb_output_files], oc->nb_streams);
bitstream_filters[nb_output_files][oc->nb_streams - 1]= subtitle_bitstream_filters;
subtitle_bitstream_filters= NULL;