[FFmpeg-cvslog] r24305 - trunk/ffmpeg.c
jai_menon
subversion
Sun Jul 18 20:20:41 CEST 2010
Author: jai_menon
Date: Sun Jul 18 20:20:41 2010
New Revision: 24305
Log:
FFmpeg : Replace some av_exit calls in av_transcode with branches to the
cleanup code.
This plugs a bunch of memleaks.
Modified:
trunk/ffmpeg.c
Modified: trunk/ffmpeg.c
==============================================================================
--- trunk/ffmpeg.c Sun Jul 18 16:01:33 2010 (r24304)
+++ trunk/ffmpeg.c Sun Jul 18 20:20:41 2010 (r24305)
@@ -2007,13 +2007,15 @@ static int av_transcode(AVFormatContext
if (!os->nb_streams) {
dump_format(output_files[i], i, output_files[i]->filename, 1);
fprintf(stderr, "Output file #%d does not contain any stream\n", i);
- av_exit(1);
+ ret = AVERROR(EINVAL);
+ goto fail;
}
nb_ostreams += os->nb_streams;
}
if (nb_stream_maps > 0 && nb_stream_maps != nb_ostreams) {
fprintf(stderr, "Number of stream maps must match number of output streams\n");
- av_exit(1);
+ ret = AVERROR(EINVAL);
+ goto fail;
}
/* Sanity check the mapping args -- do the input files & streams exist? */
@@ -2024,14 +2026,16 @@ static int av_transcode(AVFormatContext
if (fi < 0 || fi > nb_input_files - 1 ||
si < 0 || si > file_table[fi].nb_streams - 1) {
fprintf(stderr,"Could not find input stream #%d.%d\n", fi, si);
- av_exit(1);
+ ret = AVERROR(EINVAL);
+ goto fail;
}
fi = stream_maps[i].sync_file_index;
si = stream_maps[i].sync_stream_index;
if (fi < 0 || fi > nb_input_files - 1 ||
si < 0 || si > file_table[fi].nb_streams - 1) {
fprintf(stderr,"Could not find sync stream #%d.%d\n", fi, si);
- av_exit(1);
+ ret = AVERROR(EINVAL);
+ goto fail;
}
}
More information about the ffmpeg-cvslog
mailing list