diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-01-31 18:51:47 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-01-31 21:32:06 +0100 |
commit | 14b171cd71f2b5f1cc66e4df89c2692f68ac098b (patch) | |
tree | d301b4b78e21e7399d0c9b9f4206e00b1b99578f /libavfilter/vf_aspect.c | |
parent | b482c001214fc519cf6be7802458bf8e441991b7 (diff) | |
download | ffmpeg-14b171cd71f2b5f1cc66e4df89c2692f68ac098b.tar.gz |
Add sample_aspect_ratio to AVFilterLink
Diffstat (limited to 'libavfilter/vf_aspect.c')
-rw-r--r-- | libavfilter/vf_aspect.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/libavfilter/vf_aspect.c b/libavfilter/vf_aspect.c index 6f86bf2924..95bfb666ff 100644 --- a/libavfilter/vf_aspect.c +++ b/libavfilter/vf_aspect.c @@ -82,6 +82,9 @@ static int setdar_config_props(AVFilterLink *inlink) av_log(inlink->dst, AV_LOG_INFO, "w:%d h:%d -> dar:%d/%d par:%d/%d\n", inlink->w, inlink->h, dar.num, dar.den, aspect->aspect.num, aspect->aspect.den); + + inlink->sample_aspect_ratio = aspect->aspect; + return 0; } @@ -108,6 +111,16 @@ AVFilter avfilter_vf_setdar = { #endif /* CONFIG_SETDAR_FILTER */ #if CONFIG_SETSAR_FILTER +/* for setdar filter, convert from frame aspect ratio to pixel aspect ratio */ +static int setsar_config_props(AVFilterLink *inlink) +{ + AspectContext *aspect = inlink->dst->priv; + + inlink->sample_aspect_ratio = aspect->aspect; + + return 0; +} + AVFilter avfilter_vf_setsar = { .name = "setsar", .description = NULL_IF_CONFIG_SMALL("Set the pixel sample aspect ratio."), @@ -118,6 +131,7 @@ AVFilter avfilter_vf_setsar = { .inputs = (AVFilterPad[]) {{ .name = "default", .type = AVMEDIA_TYPE_VIDEO, + .config_props = setsar_config_props, .get_video_buffer = avfilter_null_get_video_buffer, .start_frame = start_frame, .end_frame = avfilter_null_end_frame }, |