[xiph-commits] r3203 - libannodex/trunk/src/libannodex

shans at svn.annodex.net shans at svn.annodex.net
Sun Aug 26 22:17:51 PDT 2007


Author: shans
Date: 2007-08-26 22:17:51 -0700 (Sun, 26 Aug 2007)
New Revision: 3203

Modified:
   libannodex/trunk/src/libannodex/anx_write.c
Log:
Continue writing on OGGZ_ERR_STOP_ERR signals from liboggz (these are produced
by libannodex returning -1, and need to be continued)



Modified: libannodex/trunk/src/libannodex/anx_write.c
===================================================================
--- libannodex/trunk/src/libannodex/anx_write.c	2007-08-26 23:27:02 UTC (rev 3202)
+++ libannodex/trunk/src/libannodex/anx_write.c	2007-08-27 05:17:51 UTC (rev 3203)
@@ -44,7 +44,7 @@
 #include "anx_private.h"
 #include "anx_snprint.h" /* anx_strdup */
 
-/* #define DEBUG */
+// #define DEBUG
 
 /* set to 0 or 1 */
 #define FLUSH_ALWAYS 0
@@ -1472,23 +1472,36 @@
 long
 anx_write_output (ANNODEX * annodex, unsigned char * buf, long n)
 {
+  int r;
   if (!_anx_ready (annodex)) {
     anx_set_error (annodex, ANX_ERR_NOTREADY);
     return -1L;
   }
 
-  return oggz_write_output (annodex->oggz, buf, n);
+  r = oggz_write_output (annodex->oggz, buf, n);
+  while (r == OGGZ_ERR_STOP_ERR) {
+    r = oggz_write_output (annodex->oggz, buf, n);
+  }
+
+  return r;
+
 }
 
 long
 anx_write (ANNODEX * annodex, long n)
 {
+  int r;
   if (!_anx_ready (annodex)) {
     anx_set_error (annodex, ANX_ERR_NOTREADY);
     return -1L;
   }
 
-  return oggz_write (annodex->oggz, n);
+  r = oggz_write (annodex->oggz, n);
+  while (r == OGGZ_ERR_STOP_ERR) {
+    r = oggz_write (annodex->oggz, n);
+  }
+
+  return r;
 }
 
 long



More information about the commits mailing list