From patchwork Thu Dec 7 09:23:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul B Mahol X-Patchwork-Id: 6579 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.161.94 with SMTP id m30csp8048542jah; Thu, 7 Dec 2017 01:32:08 -0800 (PST) X-Google-Smtp-Source: AGs4zMb41qCIOzeEfmZKtZpBLv4caG+tlnNRuKo0r1dloa3tfW7eMtqAxZMtKzy1gmGrlR1dvyCn X-Received: by 10.28.239.4 with SMTP id n4mr577436wmh.31.1512639128470; Thu, 07 Dec 2017 01:32:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512639128; cv=none; d=google.com; s=arc-20160816; b=mqAM0Hb0XzXtvXuUZhq4PDvG7/hSScTlt6IBQDSBlSNln8xqBm1tUpkzOHzawN922z NQsO+UrPMGjjvUx8i4CTrXmKbQRuBn6Ezaqa/j4TFbPADxsUmL3Iv+msS6pA4V4JM9Z0 pAQR7UUmrmC9+XSiYMAYIr+H/MwKArJOsLf3+cSyyb6NGGenYbbxVo7p1tvwpFA2U5m0 s8xMM7MCC9jb53KmJgRp0itL3+dIkg1e8lCk8UXd18FsiQWSy1Lkkn1wdU+CJ7MseVps gO9BGOs++mMMJES1WZs61SWVQrv+rV4dMAM1dR+qV9fi8U0KadXXhcFBSdRs9+V7Ygo/ P+lg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:dkim-signature :delivered-to:arc-authentication-results; bh=SOQ5XbpXD9zDJr2BiuzvHfq5ufuc/gF0HjRTHIgcKBk=; b=0ucIyNHWRXspkgeD5nmb1yIuR9/9hxiN2ayKmgFdN0mHXRO5ZBTb3GQRR19aqOCBiz CsfipER+r8ANjVjQ+9YeehjT1fQf3/5qLnagZpCEStVfzEORtx7wwQ2PPSo5EBpuSfmN dIZ8lvQV51gaDo4SbQwnt8es6RTQKpNf45xXeB31/vTuYqqgjokcVEAk5y6YtsTXSedt rzZ94//FVPwbzMJ8dVZ/LJprgFC6URLEOxM31+L/w2LPYGG4NOxSkBy8klP0H0r/jgZ7 ikLiZlLXidIJuuhTMBd3Lg11TU5EoEzi6bUByUXOfk8pppZzdjvWZtKoK9fCol6uREY4 PPnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=TdMPKQg0; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id k78si3700696wrc.84.2017.12.07.01.32.08; Thu, 07 Dec 2017 01:32:08 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=TdMPKQg0; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1E4E668A2B1; Thu, 7 Dec 2017 11:32:01 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com [74.125.82.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2EE9768A0AD for ; Thu, 7 Dec 2017 11:31:55 +0200 (EET) Received: by mail-wm0-f68.google.com with SMTP id f206so11599244wmf.5 for ; Thu, 07 Dec 2017 01:32:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id; bh=nvqsg4dN6tDszh94gQN3DJ16S8RsEu3R9p4AHExzZ24=; b=TdMPKQg0DO9pNFopDNFJysc/MVRgyaX0RB0ky+/E7psIiYwcj1CI+mt+uFWq1IlwQS UKG89tw2Wn12pCQQLvelSHhkW66iiWZ8woIVEO3HzU6nw8mNxiW68Y2sSUmuCBz/YnJo YvOPLdX7CN/gdZoIFWTxBzw92Wc/BL0x5vaRkaVXaK8pmxZ/f2qyCRiRkoRNh8b9bGdd QdYegWj/H8u0od9CEqowTfdebo5l/4sUEw6HfOcTjb+20AYX//XsSOQKJS5G6X60INPF UOFU8wzBg7LS8XfQkL1Sv0kHOwwT6IWqPJiqPX9GDUpV34Ti/w1VVjKhLxbTuiaheHY9 eX+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=nvqsg4dN6tDszh94gQN3DJ16S8RsEu3R9p4AHExzZ24=; b=WygnSSMZdsWnBrq650VriddeF0PAKofmT8hcLGUPGAumNU1EHWSXI7p7744O4Vc1SF H50FYuCR8D2O4fe4q8tNFHuYclf/sWMVLkFS0DdhOOMXjDMQBeh9HfTeocV+35z0KKme JbOwMeKcR06DzugfzEiIvusq/aCsnl4Z/qqA9fb0SN6LRdhiheVni7Lz3MPwk/1nERCS rl5XYNH5kpFymxb95CJnI46dZEnyIawi4jlYF0UXbzQyOfSti87wnwuYB+g8a8Wd3K3a a0Bj/AczKlplVnKEiobrd3OFIbqeBrHjTB5Trscembota3e6K0PR1MwcFI5k8AivZJbk jueA== X-Gm-Message-State: AKGB3mJyDZpfD4d6HHi+TV4eC5z7RqCMkvPycugyIIwOuS7PNDSENntG 6xEGkUjlYtueHuNeHQ4NWLcagw== X-Received: by 10.28.206.8 with SMTP id e8mr518710wmg.80.1512638654926; Thu, 07 Dec 2017 01:24:14 -0800 (PST) Received: from localhost.localdomain ([94.250.174.60]) by smtp.gmail.com with ESMTPSA id y51sm5121799wrc.96.2017.12.07.01.24.14 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Dec 2017 01:24:14 -0800 (PST) From: Paul B Mahol To: ffmpeg-devel@ffmpeg.org Date: Thu, 7 Dec 2017 10:23:33 +0100 Message-Id: <20171207092333.17016-1-onemda@gmail.com> X-Mailer: git-send-email 2.11.0 Subject: [FFmpeg-devel] [PATCH] avfilter/video: pick sar from link X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: Paul B Mahol --- libavfilter/video.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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)