From patchwork Thu Oct 6 21:49:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marton Balint X-Patchwork-Id: 900 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.140.66 with SMTP id o63csp1110123vsd; Thu, 6 Oct 2016 14:49:24 -0700 (PDT) X-Received: by 10.28.26.86 with SMTP id a83mr1839283wma.10.1475790564193; Thu, 06 Oct 2016 14:49:24 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id bp10si19041231wjc.237.2016.10.06.14.49.22; Thu, 06 Oct 2016 14:49:24 -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 B3946689BE3; Fri, 7 Oct 2016 00:49:04 +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 E66E3689AC5 for ; Fri, 7 Oct 2016 00:48:58 +0300 (EEST) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 5D9F6100C72; Thu, 6 Oct 2016 23:49:14 +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 tswYnZqJ-oDt; Thu, 6 Oct 2016 23:49:13 +0200 (CEST) Received: from bluegene.passwd.hu (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 165F8100C49; Thu, 6 Oct 2016 23:49:08 +0200 (CEST) From: Marton Balint To: ffmpeg-devel@ffmpeg.org Date: Thu, 6 Oct 2016 23:49:06 +0200 Message-Id: <1475790546-16416-1-git-send-email-cus@passwd.hu> X-Mailer: git-send-email 2.6.6 Subject: [FFmpeg-devel] [PATCH] lavfi/metadata: fix metadata deletion if comparison returns false 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" Signed-off-by: Marton Balint --- libavfilter/f_metadata.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libavfilter/f_metadata.c b/libavfilter/f_metadata.c index f4a929c..f2c71d9 100644 --- a/libavfilter/f_metadata.c +++ b/libavfilter/f_metadata.c @@ -330,9 +330,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame) case METADATA_DELETE: if (!s->key) { av_dict_free(metadata); - } else if (e && e->value && s->value && s->compare(s, e->value, s->value)) { - av_dict_set(metadata, s->key, NULL, 0); - } else if (e && e->value) { + } else if (e && e->value && (!s->value || s->compare(s, e->value, s->value))) { av_dict_set(metadata, s->key, NULL, 0); } return ff_filter_frame(outlink, frame);