summaryrefslogtreecommitdiff
path: root/ffmpeg.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2010-02-23 16:31:14 +0000
committerMichael Niedermayer <michaelni@gmx.at>2010-02-23 16:31:14 +0000
commit247e3954fc710ac3f8a9a10ad1e006304cad81fa (patch)
treef7fecfedb3edd4f51a0df9043e243db11d2b87a4 /ffmpeg.c
parentab392695d50ca29fa89e5ddce3df3cbf739ef654 (diff)
Favor streams with more packets if the user did not specify what she wants.
Fixes issue1156 Originally committed as revision 22002 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'ffmpeg.c')
-rw-r--r--ffmpeg.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index ad45ea3218..ecaa7e114d 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1777,6 +1777,7 @@ static int av_encode(AVFormatContext **output_files,
}
} else {
+ int best_nb_frames=-1;
/* get corresponding input stream index : we select the first one with the right type */
found = 0;
for(j=0;j<nb_istreams;j++) {
@@ -1797,9 +1798,11 @@ static int av_encode(AVFormatContext **output_files,
}
if (ist->discard && ist->st->discard != AVDISCARD_ALL && !skip &&
ist->st->codec->codec_type == ost->st->codec->codec_type) {
- ost->source_index = j;
- found = 1;
- break;
+ if(best_nb_frames < ist->st->codec_info_nb_frames){
+ best_nb_frames= ist->st->codec_info_nb_frames;
+ ost->source_index = j;
+ found = 1;
+ }
}
}