diff options
author | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2011-07-02 19:31:18 +0400 |
---|---|---|
committer | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2011-07-04 13:20:00 +0400 |
commit | 0bf02fb1ea57962b97fb3ffc7c827d4b12e439f3 (patch) | |
tree | 80522cba919473694c166b264f60c0d4712580d8 /libavfilter/vf_pad.c | |
parent | 01151a26c03c5df85509150d393e039f574d005f (diff) |
vf_pad: add support for a "sar" variable
Also add a "dar" alias for "a", for avoiding confusion with sar/dar.
Diffstat (limited to 'libavfilter/vf_pad.c')
-rw-r--r-- | libavfilter/vf_pad.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/libavfilter/vf_pad.c b/libavfilter/vf_pad.c index 809e458b9f..879a0b5fe8 100644 --- a/libavfilter/vf_pad.c +++ b/libavfilter/vf_pad.c @@ -45,7 +45,8 @@ static const char *var_names[] = { "out_h", "oh", "x", "y", - "a", + "a", "dar", + "sar", "hsub", "vsub", NULL @@ -61,7 +62,8 @@ enum var_name { VAR_OUT_H, VAR_OH, VAR_X, VAR_Y, - VAR_A, + VAR_A, VAR_DAR, + VAR_SAR, VAR_HSUB, VAR_VSUB, VARS_NB @@ -156,7 +158,9 @@ static int config_input(AVFilterLink *inlink) 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<<pad->hsub; var_values[VAR_VSUB] = 2<<pad->vsub; |