From patchwork Tue Oct 24 09:47:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tobias Rapp X-Patchwork-Id: 5674 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.161.90 with SMTP id m26csp422893jah; Tue, 24 Oct 2017 02:47:44 -0700 (PDT) X-Google-Smtp-Source: ABhQp+QJqvA3HxyjqkxdvbMEFa1L6x4eRyxSAtYRlHlzfpiGm4/q8N3TgU6PNru+nGUUOPAHxbye X-Received: by 10.28.84.89 with SMTP id p25mr6885370wmi.112.1508838464153; Tue, 24 Oct 2017 02:47:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508838464; cv=none; d=google.com; s=arc-20160816; b=M0z7wt43JmxF9RWCGy7zEzoRlMrlk8plOgWjSre9vpC1/Q/OqCpR3EyIdRiSN/A9Oo +ngACe7LNPQvD+d1VHaBf752/IexQEhaHejtnTJsUoViimkFhswtSWZ4J+aFqQ3QXaKa PLjlJ9dCOfU0iuc/WmZY5deeA4Q5u+vnfOnKH2c9wu/uTypKX9E40+/A0h+wq7w051Pa aDNprzFtp9E/VsTty02YlZC9nGwPQkUwFNf/8LZdF/stykvgnlRl1o9QTpZ5dA2GQ+lb PT8lxslM9f4pngrF3mw+aX4zvV1PFkSDzplM8x0zx8rQG4jmvLqBMlVSDqE3NKR1fj+4 6zSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:delivered-to:arc-authentication-results; bh=RaLyY8KzdHbj/TAQ4uXj6E/IRO2ed9uhgp/RsAoUDvA=; b=RMGaQjqDyQms/EDaZn98iywYpKNgM8h2HyYjXcQ7UorfgjSl882MZAlMY7ZGXMQoX/ mFIqiD0w3Rn3e7kFkRbGO7IpGJ9ih6i86sTtJNZyS1OIJzIKZ4UgU0B1UCe2XoYkNTTw rwBC9N9V98kJ0cUj0BGMa9XnbHb4I5VTlZ6YXp8Gtm6XVyv+a/9zjoiM1Z5beUKe4Te8 /avshPyiBYhPbtVmNyQYFOR7S8aHyqxkuE+ErvRyvADHuJUQPCwKZ5JR9I74w8G6qFgv tiHiM0dHWLIIT/jhsMyScp7dgoRJZjx4ZwogJOspQ65rKxSsbQpiTxLg/f+GtqI8Blb1 Ko9Q== ARC-Authentication-Results: i=1; mx.google.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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id o7si7591783wro.100.2017.10.24.02.47.43; Tue, 24 Oct 2017 02:47:44 -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; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7053568A27F; Tue, 24 Oct 2017 12:47:35 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mx02.mail.netstorage.at (mx02.mail.netstorage.at [89.207.146.155]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 708EF68A065 for ; Tue, 24 Oct 2017 12:47:28 +0300 (EEST) Received: from p1002.netstorage.at (p1002.netstorage.at [89.207.146.186]) by mx02.mail.netstorage.at (Postfix) with ESMTPS id D99A0A16E3; Tue, 24 Oct 2017 11:47:21 +0200 (CEST) Received: from mailix (noaport.de [46.237.252.213]) by p1002.netstorage.at (Postfix) with ESMTPA id 7F75881AA1; Tue, 24 Oct 2017 11:47:21 +0200 (CEST) Received: from frogstar-a.kuhnle.local (frogstar-a.kuhnle.local [192.168.0.26]) by mailix with ESMTPA ; Tue, 24 Oct 2017 11:47:21 +0200 From: Tobias Rapp To: ffmpeg-devel@ffmpeg.org Date: Tue, 24 Oct 2017 11:47:21 +0200 Message-Id: <1508838441-4473-1-git-send-email-t.rapp@noa-archive.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: X-PPP-Message-ID: <20171024094721.19561.26562@p1002.netstorage.at> X-PPP-Vhost: noa-archive.com X-NetStorage-MailScanner-Information: Please contact the ISP for more information X-NetStorage-MailScanner-ID: D99A0A16E3.A6DBA X-NetStorage-MailScanner: Found to be clean X-NetStorage-MailScanner-SpamCheck: not spam (whitelisted), SpamAssassin (nicht zwischen gespeichert, Wertung=-0.5, benoetigt 6, autolearn=not spam, BAYES_00 -0.50) X-NetStorage-MailScanner-From: t.rapp@noa-archive.com X-Spam-Status: No Subject: [FFmpeg-devel] [PATCH v2] avformat/wavenc: skip writing incorrect peak-of-peaks position value 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: p.bubestinger@av-rd.com, georg.lippitsch@gmx.at MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" According to EBU tech 3285 supplement 3 the dwPosPeakOfPeaks field should contain the absolute position to the maximum audio sample value, but the current implementation writes the relative peak frame index instead. Fix the issue by writing the "unknown" value (-1) for now until the feature is implemented correctly. Previous version reviewed-by: Peter Bubestinger Signed-off-by: Tobias Rapp --- v2: - added version micro bump - more code clean-up libavformat/version.h | 2 +- libavformat/wavenc.c | 11 +---------- tests/ref/lavf/wav_peak | 2 +- tests/ref/lavf/wav_peak_only | 2 +- 4 files changed, 4 insertions(+), 13 deletions(-) diff --git a/libavformat/version.h b/libavformat/version.h index 0feb788..8ae091f 100644 --- a/libavformat/version.h +++ b/libavformat/version.h @@ -33,7 +33,7 @@ // Also please add any ticket numbers that you believe might be affected here #define LIBAVFORMAT_VERSION_MAJOR 58 #define LIBAVFORMAT_VERSION_MINOR 0 -#define LIBAVFORMAT_VERSION_MICRO 100 +#define LIBAVFORMAT_VERSION_MICRO 101 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \ LIBAVFORMAT_VERSION_MINOR, \ diff --git a/libavformat/wavenc.c b/libavformat/wavenc.c index adb20cb..159119d 100644 --- a/libavformat/wavenc.c +++ b/libavformat/wavenc.c @@ -74,8 +74,6 @@ typedef struct WAVMuxContext { uint32_t peak_num_frames; uint32_t peak_outbuf_size; uint32_t peak_outbuf_bytes; - uint32_t peak_pos_pop; - uint16_t peak_pop; uint8_t *peak_output; int last_duration; int write_bext; @@ -195,7 +193,6 @@ static void peak_write_frame(AVFormatContext *s) { WAVMuxContext *wav = s->priv_data; AVCodecParameters *par = s->streams[0]->codecpar; - int peak_of_peaks; int c; if (!wav->peak_output) @@ -213,12 +210,6 @@ static void peak_write_frame(AVFormatContext *s) wav->peak_maxpos[c] = FFMAX(wav->peak_maxpos[c], wav->peak_maxneg[c]); - peak_of_peaks = FFMAX3(wav->peak_maxpos[c], wav->peak_maxneg[c], - wav->peak_pop); - if (peak_of_peaks > wav->peak_pop) - wav->peak_pos_pop = wav->peak_num_frames; - wav->peak_pop = peak_of_peaks; - if (wav->peak_outbuf_size - wav->peak_outbuf_bytes < wav->peak_format * wav->peak_ppv) { wav->peak_outbuf_size += PEAK_BUFFER_SIZE; @@ -287,7 +278,7 @@ static int peak_write_chunk(AVFormatContext *s) avio_wl32(pb, wav->peak_block_size); /* frames per value */ avio_wl32(pb, par->channels); /* number of channels */ avio_wl32(pb, wav->peak_num_frames); /* number of peak frames */ - avio_wl32(pb, wav->peak_pos_pop); /* audio sample frame index */ + avio_wl32(pb, -1); /* audio sample frame position (not implemented) */ avio_wl32(pb, 128); /* equal to size of header */ avio_write(pb, timestamp, 28); /* ASCII time stamp */ ffio_fill(pb, 0, 60); diff --git a/tests/ref/lavf/wav_peak b/tests/ref/lavf/wav_peak index aa7e5fc..861b246 100644 --- a/tests/ref/lavf/wav_peak +++ b/tests/ref/lavf/wav_peak @@ -1,3 +1,3 @@ -35148d1f6e66b0080893851d917ecbf4 *./tests/data/lavf/lavf.peak.wav +105805963fb767d00da056f42f32d9f3 *./tests/data/lavf/lavf.peak.wav 89094 ./tests/data/lavf/lavf.peak.wav ./tests/data/lavf/lavf.peak.wav CRC=0x3a1da17e diff --git a/tests/ref/lavf/wav_peak_only b/tests/ref/lavf/wav_peak_only index dccd0e7..b203d03 100644 --- a/tests/ref/lavf/wav_peak_only +++ b/tests/ref/lavf/wav_peak_only @@ -1,2 +1,2 @@ -b609a363e6d490710ed52231a8d09d3c *./tests/data/lavf/lavf.peak_only.wav +f1a8aeeae8069f3992c4d780436c3d23 *./tests/data/lavf/lavf.peak_only.wav 832 ./tests/data/lavf/lavf.peak_only.wav