aboutsummaryrefslogtreecommitdiffstats
path: root/ffmpeg.c
diff options
context:
space:
mode:
authorStefano Sabatini <stefano.sabatini-lala@poste.it>2008-08-27 18:50:46 +0000
committerStefano Sabatini <stefano.sabatini-lala@poste.it>2008-08-27 18:50:46 +0000
commitde427ff48b060815ca047399069280c9db0a2773 (patch)
tree72b3ef442d3cb1a13028f8e6f82e1a9b27311465 /ffmpeg.c
parent8649e9332c70ea447f34e7b68f0670bf1c18be5b (diff)
downloadffmpeg-de427ff48b060815ca047399069280c9db0a2773.tar.gz
Simplify the indexing logic in the av_encode() streams mapping code.
Originally committed as revision 14992 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'ffmpeg.c')
-rw-r--r--ffmpeg.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index 493cacb0df..3c683dced3 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1635,22 +1635,22 @@ static int av_encode(AVFormatContext **output_files,
n = 0;
for(k=0;k<nb_output_files;k++) {
os = output_files[k];
- for(i=0;i<os->nb_streams;i++) {
+ for(i=0;i<os->nb_streams;i++,n++) {
int found;
- ost = ost_table[n++];
+ ost = ost_table[n];
ost->file_index = k;
ost->index = i;
ost->st = os->streams[i];
if (nb_stream_maps > 0) {
- ost->source_index = file_table[stream_maps[n-1].file_index].ist_index +
- stream_maps[n-1].stream_index;
+ ost->source_index = file_table[stream_maps[n].file_index].ist_index +
+ stream_maps[n].stream_index;
/* Sanity check that the stream types match */
if (ist_table[ost->source_index]->st->codec->codec_type != ost->st->codec->codec_type) {
int i= ost->file_index;
dump_format(output_files[i], i, output_files[i]->filename, 1);
fprintf(stderr, "Codec type mismatch for mapping #%d.%d -> #%d.%d\n",
- stream_maps[n-1].file_index, stream_maps[n-1].stream_index,
+ stream_maps[n].file_index, stream_maps[n].stream_index,
ost->file_index, ost->index);
av_exit(1);
}
@@ -1700,8 +1700,8 @@ static int av_encode(AVFormatContext **output_files,
ist = ist_table[ost->source_index];
ist->discard = 0;
ost->sync_ist = (nb_stream_maps > 0) ?
- ist_table[file_table[stream_maps[n-1].sync_file_index].ist_index +
- stream_maps[n-1].sync_stream_index] : ist;
+ ist_table[file_table[stream_maps[n].sync_file_index].ist_index +
+ stream_maps[n].sync_stream_index] : ist;
}
}