Skip to content

Commit b6a2d2d

Browse files
committed
libvisual/lv_audio.c: Address warning -Wunused-function
Symptom was: > ../../libvisual-0.4.2/libvisual/lv_audio.c:129:12: error: 'audio_band_energy' defined but not used [-Werror=unused-function] > 129 | static int audio_band_energy (VisAudio *audio, int band, int length) > | ^~~~~~~~~~~~~~~~~ > ../../libvisual-0.4.2/libvisual/lv_audio.c:115:12: error: 'audio_band_total' defined but not used [-Werror=unused-function] > 115 | static int audio_band_total (VisAudio *audio, int begin, int end) > | ^~~~~~~~~~~~~~~~> ../../libvisual-0.4.2/libvisual/lv_audio.c:129:12: error: 'audio_band_energy' defined but not used [-Werror=unused-function] > 129 | static int audio_band_energy (VisAudio *audio, int band, int length) > | ^~~~~~~~~~~~~~~~~ > ../../libvisual-0.4.2/libvisual/lv_audio.c:115:12: error: 'audio_band_total' defined but not used [-Werror=unused-function] > 115 | static int audio_band_total (VisAudio *audio, int begin, int end) > | ^~~~~~~~~~~~~~~~
1 parent 26063a9 commit b6a2d2d

File tree

1 file changed

+0
-55
lines changed

1 file changed

+0
-55
lines changed

libvisual/libvisual/lv_audio.c

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@ static int audio_samplepool_dtor (VisObject *object);
3636
static int audio_samplepool_channel_dtor (VisObject *object);
3737
static int audio_sample_dtor (VisObject *object);
3838

39-
static int audio_band_total (VisAudio *audio, int begin, int end);
40-
static int audio_band_energy (VisAudio *audio, int band, int length);
41-
4239
/* Format transform functions */
4340
static int transform_format_buffer_from_float (VisBuffer *dest, VisBuffer *src, int size, int sign);
4441
static int transform_format_buffer_to_float (VisBuffer *dest, VisBuffer *src, int size, int sign);
@@ -112,34 +109,6 @@ static int audio_sample_dtor (VisObject *object)
112109
}
113110

114111

115-
static int audio_band_total (VisAudio *audio, int begin, int end)
116-
{
117-
int bpmtotal = 0;
118-
int i;
119-
120-
// for (i = begin; i < end; i++)
121-
// bpmtotal += audio->freq[2][i];
122-
123-
if (bpmtotal > 0)
124-
return bpmtotal / (end - begin);
125-
else
126-
return 0;
127-
}
128-
129-
static int audio_band_energy (VisAudio *audio, int band, int length)
130-
{
131-
int energytotal = 0;
132-
int i;
133-
134-
// for (i = 0; i < length; i++)
135-
// energytotal += audio->bpmhistory[i][band];
136-
137-
if (energytotal > 0)
138-
return energytotal / length;
139-
else
140-
return 0;
141-
}
142-
143112
/**
144113
* @defgroup VisAudio VisAudio
145114
* @{
@@ -311,30 +280,6 @@ int visual_audio_analyze (VisAudio *audio)
311280
}
312281
}
313282

314-
#endif
315-
#if 0
316-
/* BPM stuff, used for the audio energy only right now */
317-
for (i = 1023; i > 0; i--) {
318-
visual_mem_copy (&audio->bpmhistory[i], &audio->bpmhistory[i - 1], 6 * sizeof (short int));
319-
visual_mem_copy (&audio->bpmdata[i], &audio->bpmdata[i - 1], 6 * sizeof (short int));
320-
}
321-
322-
/* Calculate the audio energy */
323-
audio->energy = 0;
324-
325-
for (i = 0; i < 6; i++) {
326-
audio->bpmhistory[0][i] = audio_band_total (audio, i * 2, (i * 2) + 3);
327-
audio->bpmenergy[i] = audio_band_energy (audio, i, 10);
328-
329-
audio->bpmdata[0][i] = audio->bpmhistory[0][i] - audio->bpmenergy[i];
330-
331-
audio->energy += audio_band_energy(audio, i, 50);
332-
}
333-
334-
audio->energy >>= 7;
335-
336-
if (audio->energy > 100)
337-
audio->energy = 100;
338283
#endif
339284

340285
return VISUAL_OK;

0 commit comments

Comments
 (0)