Rockbox open source high quality audio player as a Music Player Daemon
mpris rockbox mpd libadwaita audio rust zig deno
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

codecs: abs() --> llabs() in speex and libgme

We were calling abs() on 64-bit (ie long long) variables.

Change-Id: I8326910a4ce733e9e2251aa5f9047e336c8be6df

+6 -6
+4 -4
lib/rbcodec/codecs/libgme/ym2612_emu.c
··· 466 466 { 467 467 assert( sample_rate ); 468 468 assert( !clock_rate || clock_rate > sample_rate ); 469 - 469 + 470 470 int i; 471 471 472 472 // 144 = 12 * (prescale * 2) = 12 * 6 * 2 473 473 // prescale set to 6 by default 474 - 474 + 475 475 int Frequency = (clock_rate ? (int)((FP_ONE_CLOCK * clock_rate) / sample_rate / 144) : (int)FP_ONE_CLOCK); 476 - if ( abs( Frequency - FP_ONE_CLOCK ) < 1 ) 476 + if ( llabs( Frequency - FP_ONE_CLOCK ) < 1 ) 477 477 Frequency = FP_ONE_CLOCK; 478 478 impl->YM2612.TimerBase = Frequency; 479 - 479 + 480 480 /* double Frequence = (double)Frequency / FP_ONE_CLOCK; */ 481 481 482 482 // Tableau TL :
+2 -2
lib/rbcodec/codecs/speex.c
··· 201 201 spx_int64_t avgpagelen = -1; 202 202 spx_int64_t lastgranule = -1; 203 203 204 - if(abs(pos-curpos)>10000 && headerssize>0 && curoffset-headerssize>10000) { 204 + if(llabs(pos-curpos)>10000 && headerssize>0 && curoffset-headerssize>10000) { 205 205 /* if seeking for more that 10sec, 206 206 headersize is known & more than 10kb is played, 207 207 try to guess a place to seek from the number of 208 - bytes playe for this position, this works best when 208 + bytes playe for this position, this works best when 209 209 the bitrate is relativly constant. 210 210 */ 211 211