diff mbox series

[FFmpeg-devel,1/3] ffmpeg.c: rename 'area' to 'score'

Message ID 20201014085311.14728-1-anton@khirnov.net
State New
Headers show
Series [FFmpeg-devel,1/3] ffmpeg.c: rename 'area' to 'score'
Related show

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished

Commit Message

Anton Khirnov Oct. 14, 2020, 8:53 a.m. UTC
Other factors besides area are used to pick the best video stream, so
the name 'area' is misleading.
---
 fftools/ffmpeg_opt.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

Comments

Michael Niedermayer Oct. 14, 2020, 5:15 p.m. UTC | #1
On Wed, Oct 14, 2020 at 10:53:09AM +0200, Anton Khirnov wrote:
> Other factors besides area are used to pick the best video stream, so
> the name 'area' is misleading.
> ---
>  fftools/ffmpeg_opt.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)

yes, *score is a better name, 
LGTM

thx

[...]
diff mbox series

Patch

diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c
index 19f719e3ff..a0d1b06f2d 100644
--- a/fftools/ffmpeg_opt.c
+++ b/fftools/ffmpeg_opt.c
@@ -2210,22 +2210,22 @@  static int open_output_file(OptionsContext *o, const char *filename)
 
         /* video: highest resolution */
         if (!o->video_disable && av_guess_codec(oc->oformat, NULL, filename, NULL, AVMEDIA_TYPE_VIDEO) != AV_CODEC_ID_NONE) {
-            int area = 0, idx = -1;
+            int best_score = 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;
+                int score;
                 ist = input_streams[i];
-                new_area = ist->st->codecpar->width * ist->st->codecpar->height + 100000000*!!ist->st->codec_info_nb_frames
+                score = ist->st->codecpar->width * ist->st->codecpar->height + 100000000*!!ist->st->codec_info_nb_frames
                            + 5000000*!!(ist->st->disposition & AV_DISPOSITION_DEFAULT);
                 if (ist->user_set_discard == AVDISCARD_ALL)
                     continue;
                 if((qcr!=MKTAG('A', 'P', 'I', 'C')) && (ist->st->disposition & AV_DISPOSITION_ATTACHED_PIC))
-                    new_area = 1;
+                    score = 1;
                 if (ist->st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO &&
-                    new_area > area) {
+                    score > best_score) {
                     if((qcr==MKTAG('A', 'P', 'I', 'C')) && !(ist->st->disposition & AV_DISPOSITION_ATTACHED_PIC))
                         continue;
-                    area = new_area;
+                    best_score = score;
                     idx = i;
                 }
             }