diff mbox

[FFmpeg-devel] lavfi:Fix aix compilation

Message ID 201611292203.02526.cehoyos@ag.or.at
State Accepted
Commit d44af9a38e6b116e1a89b2862f4d4f8cb9855387
Headers show

Commit Message

Carl Eugen Hoyos Nov. 29, 2016, 9:03 p.m. UTC
Hi!

Attached patch fixes aix compilation, similar to 33f5d70d

Please comment, Carl Eugen
From a959ae4347edb37dc342ef03c178a621a1c3a74a Mon Sep 17 00:00:00 2001
From: Carl Eugen Hoyos <cehoyos@ag.or.at>
Date: Tue, 29 Nov 2016 21:49:22 +0100
Subject: [PATCH] lavfi: Fix aix compilation.

Rename hz in af_apulsator.c and avf_showspectrum.c as hertz.

The aix header sys/m_param.h defines hz as __hz.
---
 libavfilter/af_apulsator.c     |    6 +++---
 libavfilter/avf_showspectrum.c |   12 ++++++------
 2 files changed, 9 insertions(+), 9 deletions(-)

Comments

Paul B Mahol Nov. 29, 2016, 10:35 p.m. UTC | #1
On 11/29/16, Carl Eugen Hoyos <cehoyos@ag.or.at> wrote:
> Hi!
>
> Attached patch fixes aix compilation, similar to 33f5d70d
>
> Please comment, Carl Eugen
>

should be ok
Carl Eugen Hoyos Dec. 1, 2016, 8:55 a.m. UTC | #2
2016-11-29 23:35 GMT+01:00 Paul B Mahol <onemda@gmail.com>:
> On 11/29/16, Carl Eugen Hoyos <cehoyos@ag.or.at> wrote:
>> Hi!
>>
>> Attached patch fixes aix compilation, similar to 33f5d70d
>>
>> Please comment, Carl Eugen
>>
>
> should be ok

Patch applied.

Thank you, Carl Eugen
diff mbox

Patch

diff --git a/libavfilter/af_apulsator.c b/libavfilter/af_apulsator.c
index 802b8d0..67711a2 100644
--- a/libavfilter/af_apulsator.c
+++ b/libavfilter/af_apulsator.c
@@ -47,7 +47,7 @@  typedef struct AudioPulsatorContext {
     double offset_r;
     double pwidth;
     double bpm;
-    double hz;
+    double hertz;
     int ms;
     int timing;
 
@@ -76,7 +76,7 @@  static const AVOption apulsator_options[] = {
     {   "hz",                   NULL, 0,                 AV_OPT_TYPE_CONST,  {.i64=UNIT_HZ},   0,          0, FLAGS, "timing" },
     { "bpm",               "set BPM", OFFSET(bpm),       AV_OPT_TYPE_DOUBLE, {.dbl=120},    30,          300, FLAGS },
     { "ms",                 "set ms", OFFSET(ms),        AV_OPT_TYPE_INT,    {.i64=500},    10,         2000, FLAGS },
-    { "hz",          "set frequency", OFFSET(hz),        AV_OPT_TYPE_DOUBLE, {.dbl=2},    0.01,          100, FLAGS },
+    { "hz",          "set frequency", OFFSET(hertz),     AV_OPT_TYPE_DOUBLE, {.dbl=2},    0.01,          100, FLAGS },
     { NULL }
 };
 
@@ -208,7 +208,7 @@  static int config_input(AVFilterLink *inlink)
     switch (s->timing) {
     case UNIT_BPM:  freq = s->bpm / 60;         break;
     case UNIT_MS:   freq = 1 / (s->ms / 1000.); break;
-    case UNIT_HZ:   freq = s->hz;               break;
+    case UNIT_HZ:   freq = s->hertz;            break;
     default: av_assert0(0);
     }
 
diff --git a/libavfilter/avf_showspectrum.c b/libavfilter/avf_showspectrum.c
index f63fbe8..8a08b20 100644
--- a/libavfilter/avf_showspectrum.c
+++ b/libavfilter/avf_showspectrum.c
@@ -1120,13 +1120,13 @@  static int showspectrumpic_request_frame(AVFilterLink *outlink)
                         dst[x] = 200;
                     }
                     for (y = 0; y < h; y += 40) {
-                        float hz = y * (inlink->sample_rate / 2) / (float)(1 << (int)ceil(log2(h)));
+                        float hertz = y * (inlink->sample_rate / 2) / (float)(1 << (int)ceil(log2(h)));
                         char *units;
 
-                        if (hz == 0)
+                        if (hertz == 0)
                             units = av_asprintf("DC");
                         else
-                            units = av_asprintf("%.2f", hz);
+                            units = av_asprintf("%.2f", hertz);
                         if (!units)
                             return AVERROR(ENOMEM);
 
@@ -1185,13 +1185,13 @@  static int showspectrumpic_request_frame(AVFilterLink *outlink)
                         dst[x] = 200;
                     }
                     for (x = 0; x < w; x += 80) {
-                        float hz = x * (inlink->sample_rate / 2) / (float)(1 << (int)ceil(log2(w)));
+                        float hertz = x * (inlink->sample_rate / 2) / (float)(1 << (int)ceil(log2(w)));
                         char *units;
 
-                        if (hz == 0)
+                        if (hertz == 0)
                             units = av_asprintf("DC");
                         else
-                            units = av_asprintf("%.2f", hz);
+                            units = av_asprintf("%.2f", hertz);
                         if (!units)
                             return AVERROR(ENOMEM);