[xiph-cvs] cvs commit: theora/lib toplevel.c

Ralph Giles giles at xiph.org
Tue Oct 21 15:06:31 PDT 2003



giles       03/10/21 18:06:31

  Modified:    include/theora theora.h
               lib      toplevel.c
  Log:
  Make theora_decode_header return OC_NEWPACKET instead of OC_BADFORMAT
  for unknown header packets. This lets us add optional headers at a later
  point without breaking backward compatibility.

Revision  Changes    Path
1.15      +2 -1      theora/include/theora/theora.h

Index: theora.h
===================================================================
RCS file: /usr/local/cvsroot/theora/include/theora/theora.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- theora.h	26 Sep 2003 15:03:48 -0000	1.14
+++ theora.h	21 Oct 2003 22:06:29 -0000	1.15
@@ -11,7 +11,7 @@
  ********************************************************************
 
   function:
-  last mod: $Id: theora.h,v 1.14 2003/09/26 15:03:48 tterribe Exp $
+  last mod: $Id: theora.h,v 1.15 2003/10/21 22:06:29 giles Exp $
 
  ********************************************************************/
 
@@ -101,6 +101,7 @@
 #define OC_VERSION     -22
 #define OC_IMPL        -23
 #define OC_BADPACKET   -24
+#define OC_NEWPACKET   -25
 
 extern const char *theora_version_string(void);
 extern ogg_uint32_t theora_version_number(void);

<p><p>1.28      +10 -1     theora/lib/toplevel.c

Index: toplevel.c
===================================================================
RCS file: /usr/local/cvsroot/theora/lib/toplevel.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- toplevel.c	15 Jun 2003 16:36:15 -0000	1.27
+++ toplevel.c	21 Oct 2003 22:06:30 -0000	1.28
@@ -11,7 +11,7 @@
  ********************************************************************
 
   function:
-  last mod: $Id: toplevel.c,v 1.27 2003/06/15 16:36:15 giles Exp $
+  last mod: $Id: toplevel.c,v 1.28 2003/10/21 22:06:30 giles Exp $
 
  ********************************************************************/
 
@@ -1301,6 +1301,15 @@
       }
 
       return(_theora_unpack_tables(ci,&opb));
+    
+    default:
+      if(ci->version_major==0 || cc->vendor==NULL || 
+         ((codec_setup_info *)ci->codec_setup)->HuffRoot[0]==NULL){
+        /* we haven't gotten the three required headers */
+        return(OC_BADHEADER);
+      }
+      /* ignore any trailing header packets for forward compatibility */
+      return(OC_NEWPACKET);
     }
   }
   return(OC_BADHEADER);

<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