summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2017-12-07 10:22:32 +0100
committerPaul B Mahol <onemda@gmail.com>2017-12-23 10:48:14 +0100
commit4754d70a23255bb378975258eff296d9bdebb687 (patch)
treed331ac0168b5f106d9fe64f88b21154ba20174f0
parentd02289c386ecf1c07f2441674c550008cb869d50 (diff)
avfilter/video: pick sar from link
It should not be needed for each filter that sets sample aspect ratio to set it explicitly also for each and every frame, instead that is automatically done in get_buffer call. Signed-off-by: Paul B Mahol <onemda@gmail.com>
-rw-r--r--libavfilter/video.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/libavfilter/video.c b/libavfilter/video.c
index 6f9020b9fe..7a8e587798 100644
--- a/libavfilter/video.c
+++ b/libavfilter/video.c
@@ -43,6 +43,7 @@ AVFrame *ff_null_get_video_buffer(AVFilterLink *link, int w, int h)
AVFrame *ff_default_get_video_buffer(AVFilterLink *link, int w, int h)
{
+ AVFrame *frame = NULL;
int pool_width = 0;
int pool_height = 0;
int pool_align = 0;
@@ -86,7 +87,13 @@ AVFrame *ff_default_get_video_buffer(AVFilterLink *link, int w, int h)
}
}
- return ff_frame_pool_get(link->frame_pool);
+ frame = ff_frame_pool_get(link->frame_pool);
+ if (!frame)
+ return NULL;
+
+ frame->sample_aspect_ratio = link->sample_aspect_ratio;
+
+ return frame;
}
AVFrame *ff_get_video_buffer(AVFilterLink *link, int w, int h)