[xiph-commits] r3241 - oogg/trunk

shans at svn.annodex.net shans at svn.annodex.net
Wed Sep 26 22:16:06 PDT 2007


Author: shans
Date: 2007-09-26 22:16:05 -0700 (Wed, 26 Sep 2007)
New Revision: 3241

Modified:
   oogg/trunk/granules.ml
   oogg/trunk/packet.ml
   oogg/trunk/packet.mli
Log:
Fixed packet gp calculation on split packets



Modified: oogg/trunk/granules.ml
===================================================================
--- oogg/trunk/granules.ml	2007-09-13 23:58:20 UTC (rev 3240)
+++ oogg/trunk/granules.ml	2007-09-27 05:16:05 UTC (rev 3241)
@@ -116,9 +116,10 @@
   let thislen = vorbis_length thispack long_size short_size in
   match lastgp with
     | None    -> None
-    | Some gp ->
+    | Some gp -> (
               Some (int64_to_oogg64 (Int64.add (oogg64_to_int64 gp)
-                  (Int64.of_int ((thislen + prevlen) / 4))));;
+                  (Int64.of_int ((thislen + prevlen) / 4)))) 
+                  );;
  
 let theora_next_gp bos prevpack thispack lastgp =
   match lastgp with

Modified: oogg/trunk/packet.ml
===================================================================
--- oogg/trunk/packet.ml	2007-09-13 23:58:20 UTC (rev 3240)
+++ oogg/trunk/packet.ml	2007-09-27 05:16:05 UTC (rev 3241)
@@ -27,11 +27,17 @@
     let oc = pcont.cont_packet in 
     pcont.cont_packet <- false; 
     match raw_data with
-      | [h] -> 
+      | [h] when page.raw.last_packet_complete -> 
           (
-            pcont.cont_packet <- not page.raw.last_packet_complete;
-          [< 'new_packet page h n oc pcont.cont_packet true >]
+            pcont.cont_packet <- false;
+              [< 'new_packet page h n oc false true >]
           )
+      | h::[r] when not page.raw.last_packet_complete ->
+          (
+            pcont.cont_packet <- true;
+              [< 'new_packet page h n oc false             true ;
+                 'new_packet page r n oc pcont.cont_packet false >]
+          )
       | h::t  -> [< 'new_packet page h n oc false false; _ptp t (n+1) >]
       | []    -> [< >] in
   _ptp page.raw.raw_data 0;;

Modified: oogg/trunk/packet.mli
===================================================================
--- oogg/trunk/packet.mli	2007-09-13 23:58:20 UTC (rev 3240)
+++ oogg/trunk/packet.mli	2007-09-27 05:16:05 UTC (rev 3241)
@@ -5,3 +5,5 @@
 val repair_splits : Types.packetStream -> Types.packetStream;;
 
 val sort : Types.packetStream -> (Types.serialNo * Types.packetStream) list;;
+
+val packetStream_to_pageStream : Types.packetStream -> Types.pageStream;;



More information about the commits mailing list