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

shans at svn.annodex.net shans at svn.annodex.net
Wed Aug 29 17:49:02 PDT 2007


Author: shans
Date: 2007-08-29 17:49:02 -0700 (Wed, 29 Aug 2007)
New Revision: 3211

Modified:
   liboggz/trunk/src/liboggz/oggz_seek.c
Log:
Reset current granulepos of reader after a seek



Modified: liboggz/trunk/src/liboggz/oggz_seek.c
===================================================================
--- liboggz/trunk/src/liboggz/oggz_seek.c	2007-08-30 00:30:37 UTC (rev 3210)
+++ liboggz/trunk/src/liboggz/oggz_seek.c	2007-08-30 00:49:02 UTC (rev 3211)
@@ -847,6 +847,8 @@
 {
   OggzReader * reader = &oggz->x.reader;
 
+  ogg_int64_t r;
+
   if (oggz == NULL) {
 #ifdef DEBUG
     printf ("oggz_seek_units: oggz NULL, FAIL\n");
@@ -870,20 +872,23 @@
 
   switch (whence) {
   case SEEK_SET:
-    return oggz_seek_set (oggz, units);
+    r = oggz_seek_set (oggz, units);
     break;
   case SEEK_CUR:
     units += reader->current_unit;
-    return oggz_seek_set (oggz, units);
+    r = oggz_seek_set (oggz, units);
     break;
   case SEEK_END:
-    return oggz_seek_end (oggz, units);
+    r = oggz_seek_end (oggz, units);
     break;
   default:
     /*oggz_set_error (oggz, OGGZ_EINVALID);*/
-    return -1;
+    r = -1;
     break;
   }
+
+  reader->current_granulepos = -1;
+  return r;
 }
 
 long



More information about the commits mailing list