From patchwork Fri Feb 10 17:50:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Almer X-Patchwork-Id: 2485 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.89.21 with SMTP id n21csp614704vsb; Fri, 10 Feb 2017 09:51:16 -0800 (PST) X-Received: by 10.28.131.72 with SMTP id f69mr9152656wmd.140.1486749076343; Fri, 10 Feb 2017 09:51:16 -0800 (PST) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id j133si2087770wma.62.2017.02.10.09.51.15; Fri, 10 Feb 2017 09:51:16 -0800 (PST) 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 sp=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 25383689D9E; Fri, 10 Feb 2017 19:51:08 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-qk0-f195.google.com (mail-qk0-f195.google.com [209.85.220.195]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6114A689725 for ; Fri, 10 Feb 2017 19:51:01 +0200 (EET) Received: by mail-qk0-f195.google.com with SMTP id i34so6035398qkh.3 for ; Fri, 10 Feb 2017 09:51:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id; bh=BJeg2r+RWK15JN82CznIGR1AKwsuxjad4kQYOftzblI=; b=IVlNCDmX3FcoEnLz+CP1OVovzWHh2jbGb9PyAWGXbjJni8Zdh+vZV195yaKcckl9Yn IfwqymcQyA2G6mlLCXYfGZaJvPEnYdjkxV5zj4nhr7yPjE8jV1EbPzk+XK2Xwb6sd1KE XYtS32drXllv5qw4G5K9Pw28g0hg7LzcafXCqY+SYOX5yjVcXofbn8X3MA6LTHfgIcWh oKSSas871H3WWVkYNJ7vFRqxmcrFULCFNPD7k9Nlk7AAF63FE6CZmu0w9fxLor3THMKA i2y8y4f2h4paL+kn59V1PIY9Ux6HFTHNtg9i503OU1mQA00j03RQLhHMc0hiqmJUG7TD VujA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=BJeg2r+RWK15JN82CznIGR1AKwsuxjad4kQYOftzblI=; b=SL79bnarxD3MKe240dsEdkQ6TAIQ7NFX7sPHpZT1ZReCWwh9PzXgMtnweuUuWxtAKY kBH1HQnfA6GuGft5u1FUai1ocy5axf1jp8LcXRc8vnZBXp6wQitZZ/X0VrkEcTkgEkOX pCY4M1F2zi+/A+/nLdsf3Ng70s0MvVHPTZo5Kvp+rf8URYiETiyEftSsoRUaK5Rur5Sy p058tZpH/0ZandnICz3n04OhCtFB11tPW/wE+3eg3cHgLagPdqAPrZSJIxrkqdom1gkw F3pIyt2SqU3/RLRmyz2DQDeAgXKBiqtJRLirBfSgWjTjapSN6LDmLXF0+7/qNfGvLfmR OuuQ== X-Gm-Message-State: AMke39khHvvBkTLyAZjnjElCfeLX59T/6JiB6USlHkBEVnOJ7r9Z+9aIdlOe7N/dN/OejA== X-Received: by 10.55.7.14 with SMTP id 14mr9065204qkh.224.1486749063864; Fri, 10 Feb 2017 09:51:03 -0800 (PST) Received: from localhost.localdomain ([181.231.87.206]) by smtp.gmail.com with ESMTPSA id z23sm2052588qkb.30.2017.02.10.09.51.02 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 10 Feb 2017 09:51:03 -0800 (PST) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Fri, 10 Feb 2017 14:50:48 -0300 Message-Id: <20170210175049.5660-1-jamrial@gmail.com> X-Mailer: git-send-email 2.11.0 Subject: [FFmpeg-devel] [PATCH 1/2] avformat/apetag: fix flag value to signal footer presence 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" According to the spec[1], a value of 0 means the footer is present and a value of 1 means it's absent, the exact opposite of header presence flag where 1 means present and 0 absent. The reason for this is compatibility with APEv1 tags, where there's no header, footer presence was mandatory for all files, and the flags field was a zeroed reserved field. [1] http://wiki.hydrogenaud.io/index.php?title=Ape_Tags_Flags Signed-off-by: James Almer --- Files already created are obviously wrong, but fortunately having the flag mistakenly reporting there's no footer is harmless in APEv2 tags stored at the end of the file (The only kind we can read and write), since footer is mandatory in those and no and such software really bothers looking at the flag. I renamed the constant just to have it as reference, or until someone feels like adding support for APEv2 tags at the beginning of a file, where footer becomes optional. libavformat/apetag.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/libavformat/apetag.c b/libavformat/apetag.c index 08e80f4aa3..a05b32d9e5 100644 --- a/libavformat/apetag.c +++ b/libavformat/apetag.c @@ -30,7 +30,7 @@ #include "internal.h" #define APE_TAG_FLAG_CONTAINS_HEADER (1 << 31) -#define APE_TAG_FLAG_CONTAINS_FOOTER (1 << 30) +#define APE_TAG_FLAG_LACKS_FOOTER (1 << 30) #define APE_TAG_FLAG_IS_HEADER (1 << 29) #define APE_TAG_FLAG_IS_BINARY (1 << 1) @@ -189,8 +189,7 @@ int ff_ape_write_tag(AVFormatContext *s) goto end; // flags - avio_wl32(dyn_bc, APE_TAG_FLAG_CONTAINS_HEADER | APE_TAG_FLAG_CONTAINS_FOOTER | - APE_TAG_FLAG_IS_HEADER); + avio_wl32(dyn_bc, APE_TAG_FLAG_CONTAINS_HEADER | APE_TAG_FLAG_IS_HEADER); ffio_fill(dyn_bc, 0, 8); // reserved ff_standardize_creation_time(s); @@ -232,7 +231,7 @@ int ff_ape_write_tag(AVFormatContext *s) avio_wl32(s->pb, count); // tag count // flags - avio_wl32(s->pb, APE_TAG_FLAG_CONTAINS_HEADER | APE_TAG_FLAG_CONTAINS_FOOTER); + avio_wl32(s->pb, APE_TAG_FLAG_CONTAINS_HEADER); ffio_fill(s->pb, 0, 8); // reserved end: