From patchwork Thu Nov 12 17:33:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23598 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 1BDAD44979A for ; Thu, 12 Nov 2020 19:34:02 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0546C68C18F; Thu, 12 Nov 2020 19:34:02 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2D46868C176 for ; Thu, 12 Nov 2020 19:33:55 +0200 (EET) Received: by mail-wr1-f67.google.com with SMTP id o15so6883065wru.6 for ; Thu, 12 Nov 2020 09:33:55 -0800 (PST) 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=S7gkl4sSYyQpHOe9ABZuTf6tJs3Odls8tzGbOQjgyaE=; b=ZYBig7jINGwneSVZUYZE/kIRxwsHRs4uHUBhZBWDqkhO0RE1nKEoRSVOjshcUTl7ei cKw81poE8xTQR/M1ZiDJy3y5RjzpcdzHiz5H2Rc73DULal38FQhn/urUpOZxYAVEiy0C zf9y4KXvUNJRZtEaL5OR6Ju06kJijG+8/vtO6kdcumEkYw+qv+NQWEGnrPy/673sCniW wjZDRuaGADNxdepAjn7JyDj02aE4hltj3B5X2FPyfMRLo5cF/JsPHEH+CfnVHw6G5i2i VwMSSrTx/MjIgzQcCxV8AbyJKaaeyqjgMEsViuobOMnwxGN3mlHSvgC/+eDtXBRJ8Qvh jojw== 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=S7gkl4sSYyQpHOe9ABZuTf6tJs3Odls8tzGbOQjgyaE=; b=j3rKOg6posODppCRqdpgzt6+gk+/Gkn6qQ9d8dMlGWv+i2241bNobp1c7kMhz23avb /XGo8vfgmqmsY8IQGohbJCjrwnXQ+hBUYiXQDzq4NbyhAy8lcSeOtFH1hLgxmisoOqcR yvbLAN8rp3UXZ3YDzgKa31pV/Krpyfbk+6kLzz3jpQQ0gAfwKYC6eTFOuulTOhUy8CCt Wi2cGtTrLAbZ0mt+k4YaUGJdEuvc0MVQ2BMto1j7fibX8kR6KmwIDhSo2fL+i2c3pSKy OG7jCIpMfwUOXQ9JvwV/R7O17QBSgnEzfSBTxjxqTOVpDhQ8YJ382RS06gcZKkUJYuKl WiPg== X-Gm-Message-State: AOAM533auYr3Z2rfexTtWdegON2xh72PpjTaKsIQn0J9L/B1hyocHoDL tf7AWKK3wvUyeF8aFT+eWJpZgolC4RRRLw== X-Google-Smtp-Source: ABdhPJw6efDOQYLrSkkS4gHr3vH/NtsBuceSMvPAVaW27GgDNAHky60OJiP6uLnMtmF0md1hLNPc6Q== X-Received: by 2002:adf:eb47:: with SMTP id u7mr658626wrn.163.1605202434380; Thu, 12 Nov 2020 09:33:54 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id n15sm7814080wrq.48.2020.11.12.09.33.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Nov 2020 09:33:53 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Thu, 12 Nov 2020 18:33:26 +0100 Message-Id: <20201112173328.742491-2-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201112173328.742491-1-andreas.rheinhardt@gmail.com> References: <20201112173328.742491-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/4] avcodec/asfdec_o: Export metadata that applies to the whole file 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" The ASF specification of Metadata Objects' stream number is as follows: "Specifies whether the entry applies to a specific digital media stream or whether it applies to the whole file. A value of 0 in this field indicates that it applies to the whole file; otherwise, the entry applies only to the indicated stream number and must be between 1 and 127." Yet the asf_o demuxer (the one originating from Libav) has always treated such metadata as if it applied to a stream even though no stream with a stream number may exist in a valid ASF file. This is fixed in this commit; it affected e.g. the file wma_with_metadata_library_object_tag_trimmed.wma from the FATE suite. Signed-off-by: Andreas Rheinhardt --- The other ASF demuxer btw applies all per-stream metadata to the whole file. libavformat/asfdec_o.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavformat/asfdec_o.c b/libavformat/asfdec_o.c index 0a7e47d8cc..2dcbc16332 100644 --- a/libavformat/asfdec_o.c +++ b/libavformat/asfdec_o.c @@ -596,7 +596,8 @@ static int asf_read_metadata_obj(AVFormatContext *s, const GUIDParseTable *g) } else { if (st_num < ASF_MAX_STREAMS) { if ((ret = process_metadata(s, name, name_len, val_len, type, - &asf->asf_sd[st_num].asf_met)) < 0) { + st_num ? &asf->asf_sd[st_num].asf_met + : &s->metadata)) < 0) { av_freep(&name); break; }