From patchwork Thu May 7 19:19:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 19541 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 92CD544A52F for ; Thu, 7 May 2020 22:20:15 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7C5D468AA21; Thu, 7 May 2020 22:20:15 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id DEB0568A7D8 for ; Thu, 7 May 2020 22:20:10 +0300 (EEST) Received: by mail-wr1-f68.google.com with SMTP id h9so7762041wrt.0 for ; Thu, 07 May 2020 12:20:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=86D5plMhz4gAXzEMO6tW96oIbkv2TQh2+4ctbWDHIVo=; b=Xhmsza5ZkvQ3V/wW5EicDzJk8jHhBc/eg8Hyrk8igrAVD0mAQFIVqqR0LXWQydSRuS U49PWYCxyz6kcXlG/LatIFTsx/EpNT5UzDsB31noE43+gmyn9xsNtwRM3EJNy5f4wDP7 lwKy9fJVRbDFChT9Lc2j3l0BYsx18TJObt5fJnJ2oQBY5nUKSx0/iiPJKAXo+PoD5n1E D7Bh/cghe+yrZ4EpfYLLslPU6wg7R3G/hFhMQ+Q+o90AD9I8dw8atNhJbw2ZAk+LJfl4 72EKAtkjFsfDaWTh+MEqJC954EQi57VJkbhBylf8kjPDs0UHyQ9X5orFtItM7W0M0iS1 Ib0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=86D5plMhz4gAXzEMO6tW96oIbkv2TQh2+4ctbWDHIVo=; b=Ez24mY9V1sEEHx+mBcy5hJ1AmkqMyvdhVsFlZrInIeVvdVRN3UuzLuv7YKxiC7GK3f Nhe7AAzM5KfPWj+da9qgicZ9MAZyz/sMtwuX4heCANpRfH6h+mK9y837v0kXVDBCez9A OsR53yKjPpN7uzbqzMu27ScMPGT3AQazIo+eBqspchMQK7e+bE7iQHAOiDk4a2MHsdTU RRV5dkivGRE2Sk3gvys85Qt/Gf77keEyOG9TDU6DaUyRsBgfJ2GxXvKqOBlm0lpjp16j xOrjHv/GdQhi069mRheRVN96aMCQNDtt51fddO8ED8CDBDjDFLLu7g7iKcHLtyzIlf3v cHwg== X-Gm-Message-State: AGi0Pubk9laEbnYVg7PLoYZEBrjQpuRGEm631P0PVQ0ANrWc6oWLhV40 Fqku9F3MNfPbLPEZs3qkktmmwbac X-Google-Smtp-Source: APiQypI5ukT5WgLaV+NgBcexchU5s3WJ8TRJcX+0tDHwSkJhy7kcg5rBl1F6wATyf0WUnyT+UrvqYg== X-Received: by 2002:a05:6000:1089:: with SMTP id y9mr17489357wrw.306.1588879210061; Thu, 07 May 2020 12:20:10 -0700 (PDT) Received: from sblaptop.fritz.box (ipbcc1ab57.dynamic.kabel-deutschland.de. [188.193.171.87]) by smtp.gmail.com with ESMTPSA id m188sm8928964wme.47.2020.05.07.12.20.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 May 2020 12:20:09 -0700 (PDT) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Thu, 7 May 2020 21:19:36 +0200 Message-Id: <20200507191937.16691-7-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200502171700.28991-8-andreas.rheinhardt@gmail.com> References: <20200502171700.28991-8-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 20/21] avformat/matroskadec: Export FileDescription as title tag 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: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Each AttachedFile in Matroska can have a FileDescription element that contains a human-friendly name for the attached file; yet this element has been ignored up until now. This commit changes this and exports it as title tag instead (the Matroska muxer mapped the title tag to the AttachedFile element since support for Attachments was added). Signed-off-by: Andreas Rheinhardt --- libavformat/matroskadec.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index 981fb4bc20..455af9d591 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -259,6 +259,7 @@ typedef struct MatroskaTrack { typedef struct MatroskaAttachment { uint64_t uid; char *filename; + char *description; char *mime; EbmlBin bin; @@ -587,7 +588,7 @@ static EbmlSyntax matroska_attachment[] = { { MATROSKA_ID_FILENAME, EBML_UTF8, 0, offsetof(MatroskaAttachment, filename) }, { MATROSKA_ID_FILEMIMETYPE, EBML_STR, 0, offsetof(MatroskaAttachment, mime) }, { MATROSKA_ID_FILEDATA, EBML_BIN, 0, offsetof(MatroskaAttachment, bin) }, - { MATROSKA_ID_FILEDESC, EBML_NONE }, + { MATROSKA_ID_FILEDESC, EBML_UTF8, 0, offsetof(MatroskaAttachment, description) }, CHILD_OF(matroska_attachments) }; @@ -2911,6 +2912,8 @@ static int matroska_read_header(AVFormatContext *s) break; av_dict_set(&st->metadata, "filename", attachments[j].filename, 0); av_dict_set(&st->metadata, "mimetype", attachments[j].mime, 0); + if (attachments[j].description) + av_dict_set(&st->metadata, "title", attachments[j].description, 0); st->codecpar->codec_id = AV_CODEC_ID_NONE; for (i = 0; mkv_image_mime_tags[i].id != AV_CODEC_ID_NONE; i++) {