author | llornkcor <llornkcor> | 2005-11-08 23:16:03 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2005-11-08 23:16:03 (UTC) |
commit | 6bd52d3658f01c966d690b12235592a5473a4d57 (patch) (unidiff) | |
tree | 76e25003b738fde6ebbea5d338b7cf76b82f47fa /core/multimedia/opieplayer/libmad/timer.c | |
parent | a8063e0797d6edf2ead22fc8c5346ddf187f0b5d (diff) | |
download | opie-6bd52d3658f01c966d690b12235592a5473a4d57.zip opie-6bd52d3658f01c966d690b12235592a5473a4d57.tar.gz opie-6bd52d3658f01c966d690b12235592a5473a4d57.tar.bz2 |
update libmad and add 64bit define
Diffstat (limited to 'core/multimedia/opieplayer/libmad/timer.c') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/multimedia/opieplayer/libmad/timer.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/core/multimedia/opieplayer/libmad/timer.c b/core/multimedia/opieplayer/libmad/timer.c index 299fe0b..fa377d0 100644 --- a/core/multimedia/opieplayer/libmad/timer.c +++ b/core/multimedia/opieplayer/libmad/timer.c | |||
@@ -1,11 +1,11 @@ | |||
1 | /* | 1 | /* |
2 | * libmad - MPEG audio decoder library | 2 | * libmad - MPEG audio decoder library |
3 | * Copyright (C) 2000-2001 Robert Leslie | 3 | * Copyright (C) 2000-2004 Underbit Technologies, Inc. |
4 | * | 4 | * |
5 | * This program is free software; you can redistribute it and/or modify | 5 | * This program is free software; you can redistribute it and/or modify |
6 | * it under the terms of the GNU General Public License as published by | 6 | * it under the terms of the GNU General Public License as published by |
7 | * the Free Software Foundation; either version 2 of the License, or | 7 | * the Free Software Foundation; either version 2 of the License, or |
8 | * (at your option) any later version. | 8 | * (at your option) any later version. |
9 | * | 9 | * |
10 | * This program is distributed in the hope that it will be useful, | 10 | * This program is distributed in the hope that it will be useful, |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
@@ -73,17 +73,17 @@ void mad_timer_negate(mad_timer_t *timer) | |||
73 | } | 73 | } |
74 | 74 | ||
75 | /* | 75 | /* |
76 | * NAME:timer->abs() | 76 | * NAME:timer->abs() |
77 | * DESCRIPTION:return the absolute value of a timer | 77 | * DESCRIPTION:return the absolute value of a timer |
78 | */ | 78 | */ |
79 | mad_timer_t mad_timer_abs(mad_timer_t timer) | 79 | mad_timer_t mad_timer_abs(mad_timer_t timer) |
80 | { | 80 | { |
81 | if (mad_timer_sign(timer) < 0) | 81 | if (timer.seconds < 0) |
82 | mad_timer_negate(&timer); | 82 | mad_timer_negate(&timer); |
83 | 83 | ||
84 | return timer; | 84 | return timer; |
85 | } | 85 | } |
86 | 86 | ||
87 | /* | 87 | /* |
88 | * NAME:reduce_timer() | 88 | * NAME:reduce_timer() |
89 | * DESCRIPTION:carry timer fraction into seconds | 89 | * DESCRIPTION:carry timer fraction into seconds |
@@ -322,17 +322,18 @@ signed long mad_timer_count(mad_timer_t timer, enum mad_units units) | |||
322 | * DESCRIPTION:return fractional part of timer in arbitrary terms | 322 | * DESCRIPTION:return fractional part of timer in arbitrary terms |
323 | */ | 323 | */ |
324 | unsigned long mad_timer_fraction(mad_timer_t timer, unsigned long denom) | 324 | unsigned long mad_timer_fraction(mad_timer_t timer, unsigned long denom) |
325 | { | 325 | { |
326 | timer = mad_timer_abs(timer); | 326 | timer = mad_timer_abs(timer); |
327 | 327 | ||
328 | switch (denom) { | 328 | switch (denom) { |
329 | case 0: | 329 | case 0: |
330 | return MAD_TIMER_RESOLUTION / timer.fraction; | 330 | return timer.fraction ? |
331 | MAD_TIMER_RESOLUTION / timer.fraction : MAD_TIMER_RESOLUTION + 1; | ||
331 | 332 | ||
332 | case MAD_TIMER_RESOLUTION: | 333 | case MAD_TIMER_RESOLUTION: |
333 | return timer.fraction; | 334 | return timer.fraction; |
334 | 335 | ||
335 | default: | 336 | default: |
336 | return scale_rational(timer.fraction, MAD_TIMER_RESOLUTION, denom); | 337 | return scale_rational(timer.fraction, MAD_TIMER_RESOLUTION, denom); |
337 | } | 338 | } |
338 | } | 339 | } |