[xiph-commits] r9379 - trunk/vorbis-tools/ogginfo

j at motherfish-iii.xiph.org j at motherfish-iii.xiph.org
Mon Jun 6 10:15:14 PDT 2005


Author: j
Date: 2005-06-06 10:15:11 -0700 (Mon, 06 Jun 2005)
New Revision: 9379

Modified:
   trunk/vorbis-tools/ogginfo/ogginfo2.c
Log:
- use \x01vorbis and \x80theora
- remove second newline
- fix comment parser, was broken in changeset:9352



Modified: trunk/vorbis-tools/ogginfo/ogginfo2.c
===================================================================
--- trunk/vorbis-tools/ogginfo/ogginfo2.c	2005-06-06 16:14:20 UTC (rev 9378)
+++ trunk/vorbis-tools/ogginfo/ogginfo2.c	2005-06-06 17:15:11 UTC (rev 9379)
@@ -188,10 +188,10 @@
 
     val = comment;
 
-    j = sep-comment+1;
-    while(j < comment)
+    j = sep-comment[i]+1;
+    while(j < comment[i])
     {
-        remaining = comment - j;
+        remaining = comment[i] - j;
         if((val[j] & 0x80) == 0)
             bytes = 1;
         else if((val[j] & 0x40) == 0x40) {
@@ -334,7 +334,7 @@
                 info(_("Vendor: %s\n"), inf->tc.vendor);
                 info(_("Width: %d\n"), inf->ti.frame_width);
                 info(_("Height: %d\n"), inf->ti.frame_height);
-		info(_("Total image: %d by %d, offset x %d, offset y %d\n\n"),
+		info(_("Total image: %d by %d, offset x %d, offset y %d\n"),
 		    inf->ti.width, inf->ti.height, inf->ti.offset_x, inf->ti.offset_y);
 		if(inf->ti.offset_x + inf->ti.frame_width > inf->ti.width)
 		    warn(_("Frame offset/size invalid: width incorrect\n"));
@@ -734,9 +734,9 @@
             warn(_("Warning: Invalid header page, no packet found\n"));
             null_start(stream);
         }
-        else if(packet.bytes >= 7 && memcmp(packet.packet, "\001vorbis", 7)==0)
+        else if(packet.bytes >= 7 && memcmp(packet.packet, "\x01vorbis", 7)==0)
             vorbis_start(stream);
-        else if(packet.bytes >= 7 && memcmp(packet.packet, "\200theora", 7)==0) 
+        else if(packet.bytes >= 7 && memcmp(packet.packet, "\x80theora", 7)==0) 
             theora_start(stream);
         else if(packet.bytes >= 8 && memcmp(packet.packet, "OggMIDI\0", 8)==0) 
             other_start(stream, "MIDI");



More information about the commits mailing list