aboutsummaryrefslogtreecommitdiffstats
path: root/ffmpeg.c
diff options
context:
space:
mode:
authorAurelien Jacobs <aurel@gnuage.org>2010-10-01 21:52:09 +0000
committerAurelien Jacobs <aurel@gnuage.org>2010-10-01 21:52:09 +0000
commit3a8e882419920455cbd5d75af1d0d5d16aa7ddb9 (patch)
tree9ddd9653a621003ccc6b5d4932e1a36c56c4780b /ffmpeg.c
parent0a6d97b371a93d76b6af2b1122c0f3a0c6a0aefd (diff)
downloadffmpeg-3a8e882419920455cbd5d75af1d0d5d16aa7ddb9.tar.gz
ffmpeg: dynamically allocate stream_maps
Originally committed as revision 25302 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'ffmpeg.c')
-rw-r--r--ffmpeg.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index 3256d24bc6..666d0967b7 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -118,7 +118,7 @@ static AVCodec **output_codecs = NULL;
static int nb_output_files = 0;
static int nb_output_codecs = 0;
-static AVStreamMap stream_maps[MAX_FILES*MAX_STREAMS];
+static AVStreamMap *stream_maps = NULL;
static int nb_stream_maps;
static AVMetaDataMap meta_data_maps[MAX_FILES];
@@ -623,6 +623,7 @@ static int ffmpeg_exit(int ret)
av_free(streamid_map);
av_free(input_codecs);
av_free(output_codecs);
+ av_free(stream_maps);
av_free(video_codec_name);
av_free(audio_codec_name);
@@ -3032,7 +3033,8 @@ static void opt_map(const char *arg)
AVStreamMap *m;
char *p;
- m = &stream_maps[nb_stream_maps++];
+ stream_maps = grow_array(stream_maps, sizeof(*stream_maps), &nb_stream_maps, nb_stream_maps + 1);
+ m = &stream_maps[nb_stream_maps-1];
m->file_index = strtol(arg, &p, 0);
if (*p)