diff mbox

[FFmpeg-devel] lavfi/ebur128: specify scaling_factor directly

Message ID 1479001419-23538-1-git-send-email-cus@passwd.hu
State Accepted
Commit 0f8b852a64289cf60271f76784106bb8e606da79
Headers show

Commit Message

Marton Balint Nov. 13, 2016, 1:43 a.m. UTC
This should fix build with Solaris CC.

Signed-off-by: Marton Balint <cus@passwd.hu>
---
 libavfilter/ebur128.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

Comments

Michael Niedermayer Nov. 13, 2016, 1:53 a.m. UTC | #1
On Sun, Nov 13, 2016 at 02:43:39AM +0100, Marton Balint wrote:
> This should fix build with Solaris CC.
> 
> Signed-off-by: Marton Balint <cus@passwd.hu>
> ---
>  libavfilter/ebur128.c | 11 +++++------
>  1 file changed, 5 insertions(+), 6 deletions(-)

LGTM

thx

[...]
Marton Balint Nov. 13, 2016, 2:29 a.m. UTC | #2
On Sun, 13 Nov 2016, Michael Niedermayer wrote:

> On Sun, Nov 13, 2016 at 02:43:39AM +0100, Marton Balint wrote:
>> This should fix build with Solaris CC.
>>
>> Signed-off-by: Marton Balint <cus@passwd.hu>
>> ---
>>  libavfilter/ebur128.c | 11 +++++------
>>  1 file changed, 5 insertions(+), 6 deletions(-)
>
> LGTM
>

Applied, thanks.

Marton
diff mbox

Patch

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)
 {