From patchwork Sun Nov 13 01:43:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marton Balint X-Patchwork-Id: 1401 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.90.1 with SMTP id o1csp454967vsb; Sat, 12 Nov 2016 17:43:58 -0800 (PST) X-Received: by 10.194.80.74 with SMTP id p10mr14247048wjx.121.1479001438446; Sat, 12 Nov 2016 17:43:58 -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 h194si39523100wmd.115.2016.11.12.17.43.57; Sat, 12 Nov 2016 17:43:58 -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; 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 27ADA689C19; Sun, 13 Nov 2016 03:43:56 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from iq.passwd.hu (iq.passwd.hu [217.27.212.140]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 82C08689A69 for ; Sun, 13 Nov 2016 03:43:49 +0200 (EET) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 1F32F100BC0; Sun, 13 Nov 2016 02:43:49 +0100 (CET) X-Virus-Scanned: amavisd-new at passwd.hu Received: from iq.passwd.hu ([127.0.0.1]) by localhost (iq.passwd.hu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kFJPdCDZxXOR; Sun, 13 Nov 2016 02:43:47 +0100 (CET) Received: from bluegene.passwd.hu (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 97189100B58; Sun, 13 Nov 2016 02:43:47 +0100 (CET) From: Marton Balint To: ffmpeg-devel@ffmpeg.org Date: Sun, 13 Nov 2016 02:43:39 +0100 Message-Id: <1479001419-23538-1-git-send-email-cus@passwd.hu> X-Mailer: git-send-email 2.6.6 Subject: [FFmpeg-devel] [PATCH] lavfi/ebur128: specify scaling_factor directly 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: Marton Balint MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" This should fix build with Solaris CC. Signed-off-by: Marton Balint --- libavfilter/ebur128.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/libavfilter/ebur128.c b/libavfilter/ebur128.c index 8e216c4..a46692e 100644 --- a/libavfilter/ebur128.c +++ b/libavfilter/ebur128.c @@ -312,12 +312,10 @@ void ff_ebur128_destroy(FFEBUR128State ** st) *st = NULL; } -#define EBUR128_FILTER(type, min_scale, max_scale) \ +#define EBUR128_FILTER(type, scaling_factor) \ static void ebur128_filter_##type(FFEBUR128State* st, const type** srcs, \ size_t src_index, size_t frames, \ int stride) { \ - static double scaling_factor = -((double) min_scale) > (double) max_scale ? \ - -((double) min_scale) : (double) max_scale; \ double* audio_data = st->d->audio_data + st->d->audio_data_index; \ size_t i, c; \ \ @@ -363,9 +361,10 @@ static void ebur128_filter_##type(FFEBUR128State* st, const type** srcs, st->d->v[ci][1] = fabs(st->d->v[ci][1]) < DBL_MIN ? 0.0 : st->d->v[ci][1]; \ } \ } -EBUR128_FILTER(short, SHRT_MIN, SHRT_MAX) -EBUR128_FILTER(int, INT_MIN, INT_MAX) -EBUR128_FILTER(float, -1.0f, 1.0f) EBUR128_FILTER(double, -1.0, 1.0) +EBUR128_FILTER(short, -((double)SHRT_MIN)) +EBUR128_FILTER(int, -((double)INT_MIN)) +EBUR128_FILTER(float, 1.0) +EBUR128_FILTER(double, 1.0) static double ebur128_energy_to_loudness(double energy) {