aboutsummaryrefslogtreecommitdiff
path: root/ffmpeg_opt.c
diff options
context:
space:
mode:
authorMichael Niedermayer2012-09-25 23:59:34 +0200
committerMichael Niedermayer2012-09-25 23:59:34 +0200
commita7b483953d1ae433dc9d498ae77342a153539a08 (patch)
treeab8e821da40041593513f7de5132d3dc189c0047 /ffmpeg_opt.c
parentc5e2347373453c61790e413a0fe0f1e6b4d65882 (diff)
ffmpeg: factor area out of video stream selection code.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'ffmpeg_opt.c')
-rw-r--r--ffmpeg_opt.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c
index e46880c91a..076852d946 100644
--- a/ffmpeg_opt.c
+++ b/ffmpeg_opt.c
@@ -1496,12 +1496,14 @@ void opt_output_file(void *optctx, const char *filename)
int area = 0, idx = -1;
int qcr = avformat_query_codec(oc->oformat, oc->oformat->video_codec, 0);
for (i = 0; i < nb_input_streams; i++) {
+ int new_area;
ist = input_streams[i];
+ new_area = ist->st->codec->width * ist->st->codec->height;
if (ist->st->codec->codec_type == AVMEDIA_TYPE_VIDEO &&
- ist->st->codec->width * ist->st->codec->height > area) {
+ new_area > area) {
if((qcr==MKTAG('A', 'P', 'I', 'C')) && !(ist->st->disposition & AV_DISPOSITION_ATTACHED_PIC))
continue;
- area = ist->st->codec->width * ist->st->codec->height;
+ area = new_area;
idx = i;
}
}