[xiph-commits] r17696 - trunk/squishyball

xiphmont at svn.xiph.org xiphmont at svn.xiph.org
Wed Dec 1 06:51:49 PST 2010


Author: xiphmont
Date: 2010-12-01 06:51:49 -0800 (Wed, 01 Dec 2010)
New Revision: 17696

Modified:
   trunk/squishyball/loader.c
Log:
Fix the Vorbis load support



Modified: trunk/squishyball/loader.c
===================================================================
--- trunk/squishyball/loader.c	2010-12-01 14:40:04 UTC (rev 17695)
+++ trunk/squishyball/loader.c	2010-12-01 14:51:49 UTC (rev 17696)
@@ -96,7 +96,7 @@
 
 static int vorbis_id(char *path,unsigned char *buf){
   return memcmp(buf, "OggS", 4) == 0 &&
-    memcmp (buf+28, "\x01vorbis", 7);
+    memcmp (buf+28, "\x01vorbis", 7) == 0;
 }
 
 static int sw_id(char *path,unsigned char *buf){
@@ -872,6 +872,7 @@
   }
 
   vi=ov_info(&vf,-1);
+  pcm = calloc(1,sizeof(pcm_t));
   pcm->path=strdup(path);
   pcm->bits=-32;
   pcm->ch=vi->channels;
@@ -964,7 +965,7 @@
       fprintf(stderr,"Unhandled case: sizeof(float)!=4\n");
       exit(10);
     }
-    fill += ret*pcm->ch*3;
+    fill += ret*pcm->ch*4;
     if (sb_verbose && (throttle&0x3f)==0)
       fprintf(stderr,"\rLoading %s: %ld to go...       ",pcm->path,(long)(pcm->size-fill));
     throttle++;
@@ -1019,6 +1020,7 @@
     }
     j++;
   }
+  fprintf(stderr,"%s: Unrecognized file format\n",path);
   return NULL;
 }
 



More information about the commits mailing list