From: Rudolf Polzer <[email protected]> Before, it just returned width/height. Correct is width/height*sar.
That way it is consistent with DAR as in probe output and setdar. Signed-off-by: Rudolf Polzer <[email protected]> Conflicts: Changelog --- Changelog | 1 + doc/filters.texi | 7 +++++-- libavfilter/version.h | 2 +- libavfilter/vf_scale.c | 3 ++- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Changelog b/Changelog index af2f793..e11dd7f 100644 --- a/Changelog +++ b/Changelog @@ -41,6 +41,7 @@ version 10: - Enhanced Low Delay AAC (ER AAC ELD) decoding (no LD SBR support) - F4V muxer - setsar/setdar filters now support variables in ratio expressions +- dar variable in the scale filter now returns the actual DAR (i.e. a * sar) version 9: diff --git a/doc/filters.texi b/doc/filters.texi index afb48b1..85c78b1 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -1856,12 +1856,15 @@ the output (cropped) width and height @item ow, oh same as @var{out_w} and @var{out_h} -@item dar, a -input display aspect ratio, same as @var{iw} / @var{ih} +@item a +same as @var{iw} / @var{ih} @item sar input sample aspect ratio +@item dar +input display aspect ratio, it is the same as (@var{iw} / @var{ih}) * @var{sar} + @item hsub, vsub horizontal and vertical chroma subsample values. For example for the pixel format "yuv422p" @var{hsub} is 2 and @var{vsub} is 1. diff --git a/libavfilter/version.h b/libavfilter/version.h index 02f348e..bc079b4 100644 --- a/libavfilter/version.h +++ b/libavfilter/version.h @@ -31,7 +31,7 @@ #define LIBAVFILTER_VERSION_MAJOR 3 #define LIBAVFILTER_VERSION_MINOR 11 -#define LIBAVFILTER_VERSION_MICRO 0 +#define LIBAVFILTER_VERSION_MICRO 1 #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \ LIBAVFILTER_VERSION_MINOR, \ diff --git a/libavfilter/vf_scale.c b/libavfilter/vf_scale.c index 096397f..c47c6f3 100644 --- a/libavfilter/vf_scale.c +++ b/libavfilter/vf_scale.c @@ -163,9 +163,10 @@ 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_DAR] = var_values[VAR_A] = (double) inlink->w / inlink->h; + var_values[VAR_A] = (double) inlink->w / inlink->h; var_values[VAR_SAR] = inlink->sample_aspect_ratio.num ? (double) inlink->sample_aspect_ratio.num / inlink->sample_aspect_ratio.den : 1; + var_values[VAR_DAR] = var_values[VAR_A] * var_values[VAR_SAR]; var_values[VAR_HSUB] = 1 << desc->log2_chroma_w; var_values[VAR_VSUB] = 1 << desc->log2_chroma_h; -- 1.7.10.4 _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
