From patchwork Thu Apr 19 19:32:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marton Balint X-Patchwork-Id: 8509 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:a02:155:0:0:0:0:0 with SMTP id c82-v6csp1043985jad; Thu, 19 Apr 2018 12:32:46 -0700 (PDT) X-Google-Smtp-Source: AB8JxZp3dBMF3TLgkhyDL23N2+9VIuOOUux8cFaoxIrFQZPGgMM0OoXhvbB0oItV2pAmiluuG/1Z X-Received: by 10.28.34.198 with SMTP id i189mr69294wmi.16.1524166366185; Thu, 19 Apr 2018 12:32:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524166366; cv=none; d=google.com; s=arc-20160816; b=fpN/rSQgmt983wi3cu70ryw40Nd/AqsYxeM9L4lvMeXSjUs9VYWr4/K6IQAXrfFhmV QTa88j8Z/WGAE0q+MYey4w/LLBDcCDtE20aBMUFpU1k/uKyjCsMJBAgvrhwHvIZ4chgo ygPGpb1STJrUUKJTv3hGiZENrMiXLEVHlNoltrOz745E5aXTV8t7+Ru1DOMsFUIN+VOW PUa7f039wDW+YJ6tTtQ+qrRvgCViKZEX5iiiu68QS1tTJ8hgdR8u+MRRb4t4FYfNsrv9 vxfp1FfFtKjot6B0+MHQC7ma/r3F/o4h24DTreVmbfsdSrnNzgPQM54a57QCivMpCJa5 p0JQ== 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:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:delivered-to:arc-authentication-results; bh=vMVLNMmMNaZggmUu8nz98R62teWeFKfxgNygHVp/gs0=; b=PoY46UpgneJOiCYgynK8ILtIOcjUFi8xL28Bi8D76gtBtpL6z1nJm6zEiEQfOsmvah 1BZmxHSBIr++BpIO68eakPtAgJiLbeqGcm5kzp111KOqrdn3KZetVJYBFCKhiJCufNVb KWiMwgD0Wj//TTHGdNbEATzhu7KMFlJauN7Ld6D4gefRZ7TtdOXRl5WKD4nMO7Q5+7Lc UNGwU4IXi1Z4r8eDUrRy5+4UBww7zOdG3bG6gXmXh+U21lWBl8zRsG1YxW/vCOrkejIi 8Puz5KcJXzZbXzEpcBY3Bi5Tk4o1vbpMwVTYn/Ci4iZV6a3il2C3ZdDzm/ohIT4qBax7 8LGQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id r23si3072902wmc.220.2018.04.19.12.32.45; Thu, 19 Apr 2018 12:32:46 -0700 (PDT) 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; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id CC641689F41; Thu, 19 Apr 2018 22:32:07 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from iq.passwd.hu (iq.passwd.hu [217.27.212.140]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 59198689EC7 for ; Thu, 19 Apr 2018 22:32:01 +0300 (EEST) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 1D839E052A; Thu, 19 Apr 2018 21:32:29 +0200 (CEST) X-Virus-Scanned: amavisd-new at passwd.hu Received: from iq.passwd.hu ([127.0.0.1]) by localhost (iq.passwd.hu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id jBXlasN4zZ7S; Thu, 19 Apr 2018 21:32:28 +0200 (CEST) Received: from bluegene.passwd.hu (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 31095E1144; Thu, 19 Apr 2018 21:32:28 +0200 (CEST) From: Marton Balint To: ffmpeg-devel@ffmpeg.org Date: Thu, 19 Apr 2018 21:32:19 +0200 Message-Id: <20180419193221.21712-2-cus@passwd.hu> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180419193221.21712-1-cus@passwd.hu> References: <20180419193221.21712-1-cus@passwd.hu> Subject: [FFmpeg-devel] [PATCH 2/4] avfilter/avfiltergraph: fix has_alpha in pick_format 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 Cc: Marton Balint MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" A pixel format which has a palette also has alpha, without this patch the format negotiation might have preferred formats without alpha even if the source had alpha. Signed-off-by: Marton Balint --- libavfilter/avfiltergraph.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavfilter/avfiltergraph.c b/libavfilter/avfiltergraph.c index 4cc6892404..e18f733e23 100644 --- a/libavfilter/avfiltergraph.c +++ b/libavfilter/avfiltergraph.c @@ -679,7 +679,7 @@ static int pick_format(AVFilterLink *link, AVFilterLink *ref) if (link->type == AVMEDIA_TYPE_VIDEO) { if(ref && ref->type == AVMEDIA_TYPE_VIDEO){ - int has_alpha= av_pix_fmt_desc_get(ref->format)->nb_components % 2 == 0; + int has_alpha= av_pix_fmt_desc_get(ref->format)->nb_components % 2 == 0 || (av_pix_fmt_desc_get(ref->format)->flags & AV_PIX_FMT_FLAG_PAL); enum AVPixelFormat best= AV_PIX_FMT_NONE; int i; for (i=0; iin_formats->nb_formats; i++) {