summaryrefslogtreecommitdiff
path: root/core/multimedia/opieplayer/libmad/timer.c
Unidiff
Diffstat (limited to 'core/multimedia/opieplayer/libmad/timer.c') (more/less context) (ignore whitespace changes)
-rw-r--r--core/multimedia/opieplayer/libmad/timer.c7
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,6 +1,6 @@
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
@@ -78,7 +78,7 @@ void mad_timer_negate(mad_timer_t *timer)
78 */ 78 */
79mad_timer_t mad_timer_abs(mad_timer_t timer) 79mad_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;
@@ -327,7 +327,8 @@ unsigned long mad_timer_fraction(mad_timer_t timer, unsigned long denom)
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;