From patchwork Tue Sep 6 03:26:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rodger Combs X-Patchwork-Id: 445 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.140.134 with SMTP id o128csp378161vsd; Mon, 5 Sep 2016 20:43:15 -0700 (PDT) X-Received: by 10.28.197.142 with SMTP id v136mr18939943wmf.11.1473133395330; Mon, 05 Sep 2016 20:43:15 -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 rr16si17070973wjb.277.2016.09.05.20.43.12; Mon, 05 Sep 2016 20:43:15 -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; dkim=neutral (body hash did not verify) header.i=@gmail.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; dmarc=fail (p=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 75A41689D50; Tue, 6 Sep 2016 06:43:01 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-oi0-f68.google.com (mail-oi0-f68.google.com [209.85.218.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D648D689D5F for ; Tue, 6 Sep 2016 06:42:54 +0300 (EEST) Received: by mail-oi0-f68.google.com with SMTP id w78so6512794oie.0 for ; Mon, 05 Sep 2016 20:43:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id; bh=UiGwqxLcc5UG7CJQWx2SRCrMM79lkPBHEhrzGk9smxk=; b=dqv9T2xe5xzu5+TjMa9XkeTgltyzsXcs71B/IeUKIE7JhNcYeQYdQalA0mBNWAfwPL l+/C5WaaXYw1OIqCDyeSDv9GPAwLEyjDAJShw4vlK2zc/iUnts6eCthsUgbXuvFXoZ5c yOq1c/RjlX5z0HF3Aqa8HlGtp1kBOleRyqq4wX1mtxIEiBOLR1vxJQewIDM6y7GMtkVh cO1imx/IXuXF1alvUR7jKJfic3wHdmyIt5WOtvVIckMzYYmwHHzTQKeh8bsQ9At3OzDE UKs3PMjOWS097xkdB8O30ICjps/7xNV8tYWVnBwi8MwTh2lZSOrk6MkqGjkbFjGYbXYP ujDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id; bh=UiGwqxLcc5UG7CJQWx2SRCrMM79lkPBHEhrzGk9smxk=; b=hwWIUuantj+UWrrx0z01mVs0QEUxTaZB/DcK3acuvIu7OjlwF7IyEBRzU/5JbLxLhq UkbrTcE1TVDqc3hSZIloYtedffKyIIE4tZgnrtM9qvJ2fHluA9Ad/tacN7kht+Jw8L2Y Irumw+56Rf/DEs8jkW1D1GpvOrWXa3r5+cUbaMYNxtdvqkIJWPy1ideD7BEKo/3UpoLg Qka2Zl/NVxJ3UJyZfy1f97Gji0tL/FRsVM5wfu7mHcHZOEHeXMfZLY9s++B7CWQK94W4 1opR0rxU5wfVryA6TA/4bN7Y0ctDFDVv50pJ94Pr1itSxo0P/Zk4m/scFH+2YrULkPeB ocyQ== X-Gm-Message-State: AE9vXwPxQLyjxk0lfaSy18OESrHK3QoRtlViuREcXFDqpDKYQg2MOCxQfM5erbdVmiZ7XA== X-Received: by 10.157.54.116 with SMTP id w107mr34556302otb.102.1473132400855; Mon, 05 Sep 2016 20:26:40 -0700 (PDT) Received: from Rodgers-MacBook-Pro.local.net (c-73-209-137-129.hsd1.il.comcast.net. [73.209.137.129]) by smtp.gmail.com with ESMTPSA id u108sm2957073ota.25.2016.09.05.20.26.39 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 05 Sep 2016 20:26:39 -0700 (PDT) From: Rodger Combs To: ffmpeg-devel@ffmpeg.org Date: Mon, 5 Sep 2016 22:26:26 -0500 Message-Id: <20160906032628.71847-1-rodger.combs@gmail.com> X-Mailer: git-send-email 2.9.3 Subject: [FFmpeg-devel] [PATCH 1/3] lavf/matroskaenc: move skipped metadata keys to separate function 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" --- libavformat/matroskaenc.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c index 2a2877f..decb66d 100644 --- a/libavformat/matroskaenc.c +++ b/libavformat/matroskaenc.c @@ -1308,6 +1308,16 @@ static int mkv_write_tag_targets(AVFormatContext *s, return 0; } +static int mkv_check_tag_name(const char *name, unsigned int elementid) +{ + return av_strcasecmp(name, "title") && + av_strcasecmp(name, "stereo_mode") && + av_strcasecmp(name, "creation_time") && + av_strcasecmp(name, "encoding_tool") && + (elementid != MATROSKA_ID_TAGTARGETS_TRACKUID || + av_strcasecmp(name, "language")); +} + static int mkv_write_tag(AVFormatContext *s, AVDictionary *m, unsigned int elementid, unsigned int uid, ebml_master *tags) { @@ -1320,12 +1330,7 @@ static int mkv_write_tag(AVFormatContext *s, AVDictionary *m, unsigned int eleme return ret; while ((t = av_dict_get(m, "", t, AV_DICT_IGNORE_SUFFIX))) { - if (av_strcasecmp(t->key, "title") && - av_strcasecmp(t->key, "stereo_mode") && - av_strcasecmp(t->key, "creation_time") && - av_strcasecmp(t->key, "encoding_tool") && - (elementid != MATROSKA_ID_TAGTARGETS_TRACKUID || - av_strcasecmp(t->key, "language"))) { + if (mkv_check_tag_name(t->key, elementid)) { ret = mkv_write_simpletag(s->pb, t); if (ret < 0) return ret;