[vlc-devel] [PATCH] aout: remove duplicate if tests
Matthew Whitworth
mwhitworth at gmail.com
Sat Mar 3 13:05:44 CET 2018
It seems like it - is a straight comparison between the two sets of
float peak/gain values the correct thing to do here then, rather than
using an epsilon in the comparison for the 0.0 - 1.0 range of the
variables?
On Fri, Mar 2, 2018 at 3:51 PM, Hugo Beauzée-Luyssen <hugo at beauzee.fr> wrote:
> On Fri, Mar 2, 2018, at 4:32 PM, Matthew Whitworth wrote:
>> (resend for correct email title)
>>
>> There are a pair of if conditions that are duplicated, cppcheck 1.82
>> picked this up.
>> ---
>> diff --git a/src/input/decoder.c b/src/input/decoder.c
>> index 98817e6f39..5fad585da4 100644
>> --- a/src/input/decoder.c
>> +++ b/src/input/decoder.c
>> @@ -298,8 +298,6 @@ static bool aout_replaygain_changed( const
>> audio_replay_gain_t *a,
>> for( size_t i=0; i<AUDIO_REPLAY_GAIN_MAX; i++ )
>> {
>> if( a->pb_gain[i] != b->pb_gain[i] ||
>> - a->pb_peak[i] != b->pb_peak[i] ||
>> - a->pb_gain[i] != b->pb_gain[i] ||
>
> Shouldn't those tests check for pf_peak & pf_gain instead?
> Nice catch nevertheless!
>
> --
> Hugo Beauzée-Luyssen
> hugo at beauzee.fr
More information about the vlc-devel
mailing list