[xiph-cvs] cvs commit: ices/src input.c

Karl Heyes karl at xiph.org
Thu Mar 11 09:00:45 PST 2004



karl        04/03/11 12:00:45

  Modified:    src      input.c
  Log:
  if we see a page we are not expecting, log a message and move onto the
  next file

Revision  Changes    Path
1.31      +8 -1      ices/src/input.c

Index: input.c
===================================================================
RCS file: /usr/local/cvsroot/ices/src/input.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- a/input.c	17 Jan 2004 04:24:10 -0000	1.30
+++ b/input.c	11 Mar 2004 17:00:44 -0000	1.31
@@ -2,7 +2,7 @@
  *  - Main producer control loop. Fetches data from input modules, and controls
  *    submission of these to the instance threads. Timing control happens here.
  *
- * $Id: input.c,v 1.30 2004/01/17 04:24:10 karl Exp $
+ * $Id: input.c,v 1.31 2004/03/11 17:00:44 karl Exp $
  * 
  * Copyright (c) 2001 Michael Smith <msmith at labyrinth.net.au>
  *
@@ -128,6 +128,7 @@
     static vorbis_info vi;
     static vorbis_comment vc;
     static int need_start_pos, need_headers, state_in_use = 0;
+    static int serialno = 0;
     static uint64_t offset;
     static uint64_t first_granulepos;
 
@@ -143,6 +144,7 @@
         if (state_in_use)
             ogg_stream_clear (&os);
         ogg_stream_init (&os, ogg_page_serialno (page));
+        serialno = ogg_page_serialno (page);
         state_in_use = 1;
         vorbis_info_init (&vi);
         vorbis_comment_init (&vc);
@@ -193,6 +195,11 @@
         ogg_stream_clear (&os);
         state_in_use = 0;
     }
+    if (serialno != ogg_page_serialno (page))
+    {
+        LOG_ERROR0 ("Found page which does not belong to current logical stream");
+        return -1;
+    }
     control.samples = ogg_page_granulepos (page) - control.oldsamples;
     control.oldsamples = ogg_page_granulepos (page);
 

<p><p>--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the commits mailing list