[xiph-commits] r3679 - liboggplay/trunk/src/liboggplay

giles at svn.annodex.net giles at svn.annodex.net
Mon Aug 4 21:34:16 PDT 2008


Author: giles
Date: 2008-08-04 21:34:16 -0700 (Mon, 04 Aug 2008)
New Revision: 3679

Modified:
   liboggplay/trunk/src/liboggplay/oggplay_callback.c
Log:
Treat a zero denominator for Skeleton basetime or presentation time
as equivalent to 0. Closes issue 412. Mozilla bug 448994. 


Modified: liboggplay/trunk/src/liboggplay/oggplay_callback.c
===================================================================
--- liboggplay/trunk/src/liboggplay/oggplay_callback.c	2008-08-05 04:22:57 UTC (rev 3678)
+++ liboggplay/trunk/src/liboggplay/oggplay_callback.c	2008-08-05 04:34:16 UTC (rev 3679)
@@ -253,8 +253,16 @@
     bt_num = extract_int64(op->packet + 28);
     bt_den = extract_int64(op->packet + 36);
 
-    decoder->presentation_time = (pt_num << 32) * 1000 / pt_den;
-    decoder->base_time = (bt_num << 32) / bt_den;
+    if (pt_den != 0) {
+      decoder->presentation_time = (pt_num << 32) * 1000 / pt_den;
+    } else {
+      decoder->presentation_time = 0;
+    }
+    if (bt_den != 0) {
+      decoder->base_time = (bt_num << 32) / bt_den;
+    } else {
+      decoder->base_time = 0;
+    }
 
     /* initialise the presentation times in the player to the values recorded in the skeleton */
     decoder->decoder.player->presentation_time = decoder->presentation_time;



More information about the commits mailing list