summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pjmedia/include/pjmedia/format.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/pjmedia/include/pjmedia/format.h b/pjmedia/include/pjmedia/format.h
index ac9fdb93..418edf68 100644
--- a/pjmedia/include/pjmedia/format.h
+++ b/pjmedia/include/pjmedia/format.h
@@ -441,11 +441,11 @@ PJ_INLINE(unsigned) PJMEDIA_SPF(unsigned clock_rate, unsigned usec_ptime,
{
#if PJ_HAS_INT64
return ((unsigned)((pj_uint64_t)usec_ptime * \
- clock_rate / channel_count / 1000000));
+ clock_rate * channel_count / 1000000));
#elif PJ_HAS_FLOATING_POINT
- return ((unsigned)(1.0*usec_ptime * clock_rate / channel_count / 1000000));
+ return ((unsigned)(1.0*usec_ptime * clock_rate * channel_count / 1000000));
#else
- return ((unsigned)(usec_ptime / 1000L * clock_rate / \
+ return ((unsigned)(usec_ptime / 1000L * clock_rate * \
channel_count / 1000));
#endif
}