1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-18 12:55:16 +00:00

Fix stupid use of multiplication to check signs which fails because of

overflow. Negative values do not seem to be used so just remove the 
failing test.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19889 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
uau 2006-09-18 14:04:50 +00:00
parent 821b4a2dc7
commit 203d128918

View File

@ -650,11 +650,9 @@ af_instance_t *af_control_any_rev (af_stream_t* s, int cmd, void* arg) {
* \brief calculate greatest common divisior of a and b.
* \ingroup af_filter
*
* Extended for negative and 0 values. If both are 0 the result is 1.
* The sign of the result will be so that it has the same sign as b.
* If both are 0 the result is 1.
*/
int af_gcd(register int a, register int b) {
int b_org = b;
while (b != 0) {
a %= b;
if (a == 0)
@ -665,8 +663,6 @@ int af_gcd(register int a, register int b) {
a += b;
if (!a)
return 1;
if (a * b_org < 0)
return -a;
return a;
}