[xiph-commits] r3681 - liboggplay/trunk/src/liboggplay
giles at svn.annodex.net
giles at svn.annodex.net
Mon Aug 4 21:56:04 PDT 2008
Author: giles
Date: 2008-08-04 21:56:04 -0700 (Mon, 04 Aug 2008)
New Revision: 3681
Modified:
liboggplay/trunk/src/liboggplay/oggplay_callback.c
Log:
Also treat a zero granulerate from oggz_get_granulerate() as a zero
granuleperiod to avoid a floating point exception.
I haven't tested this, but a stream with a zero granulerate is
conceptually one that is all headers, like a skeleton stream so
actual time based decoding should ignore it.
Modified: liboggplay/trunk/src/liboggplay/oggplay_callback.c
===================================================================
--- liboggplay/trunk/src/liboggplay/oggplay_callback.c 2008-08-05 04:35:53 UTC (rev 3680)
+++ liboggplay/trunk/src/liboggplay/oggplay_callback.c 2008-08-05 04:56:04 UTC (rev 3681)
@@ -510,7 +510,11 @@
/*
* convert num and denom to a 32.32 fixed point value
*/
- decoder->granuleperiod = (denom << 32) / num;
+ if (num != 0) {
+ decoder->granuleperiod = (denom << 32) / num;
+ } else {
+ decoder->granuleperiod = 0;
+ }
if (callbacks[content_type].init != NULL) {
callbacks[content_type].init(decoder);
More information about the commits
mailing list