From patchwork Fri Feb 10 21:02:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Almer X-Patchwork-Id: 2488 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.89.21 with SMTP id n21csp693485vsb; Fri, 10 Feb 2017 13:02:55 -0800 (PST) X-Received: by 10.28.223.6 with SMTP id w6mr9229784wmg.17.1486760575506; Fri, 10 Feb 2017 13:02:55 -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 p28si2640773wma.146.2017.02.10.13.02.54; Fri, 10 Feb 2017 13:02:55 -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 3CBAD689D99; Fri, 10 Feb 2017 23:02:48 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-qk0-f194.google.com (mail-qk0-f194.google.com [209.85.220.194]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7C6E6689D6B for ; Fri, 10 Feb 2017 23:02:41 +0200 (EET) Received: by mail-qk0-f194.google.com with SMTP id u25so6689732qki.2 for ; Fri, 10 Feb 2017 13:02:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=ogdX5QLWgUMSCJ9I0eXRkAjHfViW7qydKuL8U8+Vd58=; b=DScLw5oQGtq1D0Ju9gpoiMV5C95Le1MKYT6Th9mTlbFDps6qoYaxhpCDGILVK+s/De VTII0giIpk9A4/JGsFTrs62tyxpRqLnmKfnjQo6W3dA64HpxlJkZU0XLAkcTtOF6WfLu xq1kfZywbLMrdr3Bef9LZJEZIZszQ2jEb4c+Z5/pfv8JSktbyGPJBUKUOjCoBLKO/szb ZIJaCU9KWbT0wc2SHAcCrRaZYDIWCu4IzR6G/6sa6Opmvc81RqphOGN0IPLQhAXX1m3/ hC8SWqkIafjyry8aDk4AsBxIMJBCunEL+bMqKCrVx4ugj6+jblUvMfVeWgXlo09PW3pf enNA== 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:in-reply-to :references; bh=ogdX5QLWgUMSCJ9I0eXRkAjHfViW7qydKuL8U8+Vd58=; b=fnqwudfmrXxnIuuCPAdThgaOBu2iDdSsr/w/36iRg2moUgsUfGISGFlXXmx0NkA8TH M7Gm6cq0cIG5aCDojgQIHCyvLPDh3hLpRejuPvZw8BULJ8M+MZUk5hbNBxzv/CioPvKI kzZco7elEikNrQSXXbZkZiwXI9DgrAIQLyou+ETvMpcSOGTS0e/tb1Hsmx/TOoSaHbXt G9jFyu8ge5pWgan/5Sfg8NKsdJmrKkIRQYF3pksMjFrTHrUPb02OUIb/c+Zpx7p+w44b ADTSH8dwt1MANgVMa+n+KeWSf2Yr40piyAq2bykTuBXkELy9ZG6gQL9Of5pav0ViV9Hx X+tQ== X-Gm-Message-State: AMke39lBzn+FiMkmpilDuz65f49j2ZklINUzqNmz3gz4JN6YS7WL1v2y7/txIqAKMmFFuQ== X-Received: by 10.55.100.137 with SMTP id y131mr11884579qkb.62.1486760563391; Fri, 10 Feb 2017 13:02:43 -0800 (PST) Received: from localhost.localdomain ([181.231.87.206]) by smtp.gmail.com with ESMTPSA id i1sm2387360qte.32.2017.02.10.13.02.42 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 10 Feb 2017 13:02:42 -0800 (PST) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Fri, 10 Feb 2017 18:02:30 -0300 Message-Id: <20170210210230.7180-1-jamrial@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170210175049.5660-1-jamrial@gmail.com> References: <20170210175049.5660-1-jamrial@gmail.com> Subject: [FFmpeg-devel] [PATCH 1/3 v2] 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 --- v2 changes: Added missing fate test update. 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 +++---- tests/ref/lavf/tta | 2 +- 2 files changed, 4 insertions(+), 5 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: diff --git a/tests/ref/lavf/tta b/tests/ref/lavf/tta index 745e8d21bd..d86d097e3d 100644 --- a/tests/ref/lavf/tta +++ b/tests/ref/lavf/tta @@ -1,3 +1,3 @@ -f2721d06704ac43d89fdd25835b43598 *./tests/data/lavf/lavf.tta +d86c5cccb2554143d34d1786ab460a31 *./tests/data/lavf/lavf.tta 43200 ./tests/data/lavf/lavf.tta ./tests/data/lavf/lavf.tta CRC=0x3a1da17e