[xiph-commits] r3781 - liboggz/trunk/src/liboggz

conrad at svn.annodex.net conrad at svn.annodex.net
Fri Nov 14 13:15:41 PST 2008


Author: conrad
Date: 2008-11-14 13:15:41 -0800 (Fri, 14 Nov 2008)
New Revision: 3781

Modified:
   liboggz/trunk/src/liboggz/oggz_write.c
Log:
oggz_write: Allow negative granulepos immediately after headers, for Dirac.
This in turn removes the "Granulepos decreasing within track" oggz-validate
error for this case.


Modified: liboggz/trunk/src/liboggz/oggz_write.c
===================================================================
--- liboggz/trunk/src/liboggz/oggz_write.c	2008-11-14 21:15:35 UTC (rev 3780)
+++ liboggz/trunk/src/liboggz/oggz_write.c	2008-11-14 21:15:41 UTC (rev 3781)
@@ -271,7 +271,9 @@
   if (strict) {
     if (op->bytes < 0) return OGGZ_ERR_BAD_BYTES;
     if (!suffix && b_o_s != stream->b_o_s) return OGGZ_ERR_BAD_B_O_S;
-    if (op->granulepos != -1 && op->granulepos < stream->granulepos)
+    if (op->granulepos != -1 && op->granulepos < stream->granulepos &&
+        /* Allow negative granulepos immediately after headers, for Dirac: */
+        !(stream->granulepos == 0 && op->granulepos < 0))
       return OGGZ_ERR_BAD_GRANULEPOS;
 
     /* Allow packetno == -1 to indicate oggz should fill it in; otherwise:



More information about the commits mailing list