diff options
author | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2011-07-02 19:27:31 +0400 |
---|---|---|
committer | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2011-07-04 13:19:46 +0400 |
commit | 01151a26c03c5df85509150d393e039f574d005f (patch) | |
tree | e39b790dc424601564f32cfd0c5fca2fc9610039 /libavfilter/vf_scale.c | |
parent | 79f3384ce15db4bbf3aa49a526d79ae58ad231c2 (diff) |
vf_scale: add a "sar" variable
Also create a "dar" alias for the "a" variable, for avoiding possible
confusion between dar/sar.
Diffstat (limited to 'libavfilter/vf_scale.c')
-rw-r--r-- | libavfilter/vf_scale.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/libavfilter/vf_scale.c b/libavfilter/vf_scale.c index ef439bdbe8..3be5d99e96 100644 --- a/libavfilter/vf_scale.c +++ b/libavfilter/vf_scale.c @@ -39,7 +39,8 @@ static const char *var_names[] = { "in_h", "ih", "out_w", "ow", "out_h", "oh", - "a", + "a", "dar", + "sar", "hsub", "vsub", NULL @@ -53,7 +54,8 @@ enum var_name { VAR_IN_H, VAR_IH, VAR_OUT_W, VAR_OW, VAR_OUT_H, VAR_OH, - VAR_A, + VAR_A, VAR_DAR, + VAR_SAR, VAR_HSUB, VAR_VSUB, VARS_NB @@ -158,7 +160,9 @@ static int config_props(AVFilterLink *outlink) var_values[VAR_IN_H] = var_values[VAR_IH] = inlink->h; var_values[VAR_OUT_W] = var_values[VAR_OW] = NAN; var_values[VAR_OUT_H] = var_values[VAR_OH] = NAN; - var_values[VAR_A] = (float) inlink->w / inlink->h; + var_values[VAR_DAR] = var_values[VAR_A] = (float) inlink->w / inlink->h; + var_values[VAR_SAR] = inlink->sample_aspect_ratio.num ? + (float) inlink->sample_aspect_ratio.num / inlink->sample_aspect_ratio.den : 1; var_values[VAR_HSUB] = 1<<av_pix_fmt_descriptors[inlink->format].log2_chroma_w; var_values[VAR_VSUB] = 1<<av_pix_fmt_descriptors[inlink->format].log2_chroma_h; |