[xiph-commits] r19018 - trunk/squishyball

xiphmont at svn.xiph.org xiphmont at svn.xiph.org
Thu Nov 14 19:54:57 PST 2013


Author: xiphmont
Date: 2013-11-14 19:54:56 -0800 (Thu, 14 Nov 2013)
New Revision: 19018

Modified:
   trunk/squishyball/audio.c
   trunk/squishyball/configure.ac
   trunk/squishyball/loader.c
Log:
Minor status reporting, errant debug output cleanup


Modified: trunk/squishyball/audio.c
===================================================================
--- trunk/squishyball/audio.c	2013-11-12 09:56:21 UTC (rev 19017)
+++ trunk/squishyball/audio.c	2013-11-15 03:54:56 UTC (rev 19018)
@@ -66,6 +66,9 @@
 
   memset(flag,0,sizeof(flag));
 
+  if(sb_verbose)
+    fprintf(stderr,"\rLoading %s: checking for clipping...",pcm->name);
+
   clamp = max = get_clamp(pcm);
   min=-1.f;
 
@@ -86,6 +89,8 @@
     if(flag[j]>1)count+=flag[j];
 
   if(count){
+    if(sb_verbose)
+      fprintf(stderr,"\n");
     if(pcm->nativebits>0){
       fprintf(stderr,"CLIPPING WARNING: %ld probably clipped samples in %s;\n",(long)count,pcm->name);
       fprintf(stderr,"                  (can't be repaired with normalization)\n");
@@ -102,6 +107,9 @@
         return att;
       }
     }
+  }else{
+    if(sb_verbose)
+      fprintf(stderr,"\rLoading %s: done.                   \n",pcm->name);
   }
 
   return 1.;
@@ -391,12 +399,15 @@
   tokenize_channels(A->matrix,ai,A->ch);
   tokenize_channels(B->matrix,bi,A->ch);
 
-  for(i=0;i<A->ch;i++)
-    fprintf(stderr,"%d, ",ai[i]);
-  fprintf(stderr," -> ");
-  for(i=0;i<B->ch;i++)
-    fprintf(stderr,"%d, ",bi[i]);
-  fprintf(stderr,"\n");
+  if(sb_verbose){
+    fprintf(stderr,"remapping channels in %s: ",B->name);
+    for(i=0;i<B->ch;i++)
+      fprintf(stderr,"%d%s",bi[i],i+1==B->ch?"":", ");
+    fprintf(stderr," -> ");
+    for(i=0;i<A->ch;i++)
+      fprintf(stderr,"%d%s",ai[i],i+1==A->ch?"":", ");
+    fprintf(stderr,"\n");
+  }
 
   for(i=0;i<A->ch;i++){
     for(k=0;k<bps;k++)

Modified: trunk/squishyball/configure.ac
===================================================================
--- trunk/squishyball/configure.ac	2013-11-12 09:56:21 UTC (rev 19017)
+++ trunk/squishyball/configure.ac	2013-11-15 03:54:56 UTC (rev 19018)
@@ -4,7 +4,7 @@
 cflags_save="$CFLAGS"
 AC_PREREQ(2.57)
 AC_INIT(main.c)
-AM_INIT_AUTOMAKE(squishyball, 20131112, [vorbis-dev at xiph.org])
+AM_INIT_AUTOMAKE(squishyball, 20131114, [vorbis-dev at xiph.org])
 AC_CONFIG_FILES([Makefile])
 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])], [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
 

Modified: trunk/squishyball/loader.c
===================================================================
--- trunk/squishyball/loader.c	2013-11-12 09:56:21 UTC (rev 19017)
+++ trunk/squishyball/loader.c	2013-11-15 03:54:56 UTC (rev 19018)
@@ -348,7 +348,7 @@
     while(j<pcm->size){
       off_t bytes = (pcm->size-j > 65536 ? 65536 : pcm->size-j);
       if(sb_verbose)
-        fprintf(stderr,"\rLoading %s: %ld to go...       ",path,(long)(pcm->size-j));
+        fprintf(stderr,"\rLoading %s: %ld to go...       ",pcm->name,(long)(pcm->size-j));
       j+=bytes=fread(d+j,1,bytes,in);
       if(bytes==0)break;
     }
@@ -359,6 +359,9 @@
     }
 
     /* non float must be expanded to float */
+    if(sb_verbose)
+      fprintf(stderr,"\rLoading %s: parsing...      ",pcm->name);
+
     switch(pcm->nativebits){
     case 8:
       k=pcm->size;
@@ -414,7 +417,7 @@
   }
 
   if(sb_verbose)
-    fprintf(stderr,"\r%s: loaded.                 \n",path);
+    fprintf(stderr,"\rLoading %s: loaded.         ",pcm->name);
 
   return pcm;
  err:
@@ -630,7 +633,7 @@
     while(j<pcm->size){
       off_t bytes = (pcm->size-j > 65536 ? 65536 : pcm->size-j);
       if(sb_verbose)
-        fprintf(stderr,"\rLoading %s: %ld to go...       \r",path,(long)(pcm->size-j));
+        fprintf(stderr,"\rLoading %s: %ld to go...       \r",pcm->name,(long)(pcm->size-j));
       j+=bytes=fread(d+j,1,bytes,in);
       if(bytes==0)break;
     }
@@ -641,6 +644,9 @@
     }
 
     /* expand to float */
+    if(sb_verbose)
+      fprintf(stderr,"\rLoading %s: parsing...      ",pcm->name);
+
     switch(pcm->nativebits){
     case 8:
       k=pcm->size;
@@ -722,7 +728,7 @@
   }
 
   if(sb_verbose)
-    fprintf(stderr,"\r%s: loaded.                 \n",path);
+    fprintf(stderr,"\rLoading %s: loaded.         ",pcm->name);
 
   return pcm;
  err:
@@ -768,7 +774,7 @@
     while(j<pcm->size){
       off_t bytes = (pcm->size-j > 65536 ? 65536 : pcm->size-j);
       if(sb_verbose)
-        fprintf(stderr,"\rLoading %s: %ld to go...       ",path,(long)(pcm->size-j));
+        fprintf(stderr,"\rLoading %s: %ld to go...       ",pcm->name,(long)(pcm->size-j));
       j+=bytes=fread(pcm->data+j,1,bytes,in);
       if(bytes==0)break;
     }
@@ -778,6 +784,9 @@
       pcm->size=j;
     }
 
+    if(sb_verbose)
+      fprintf(stderr,"\rLoading %s: parsing...      ",pcm->name);
+
     for(j=pcm->size/2-1;j>=0;j--)
       f[j] = d[j]/32768.;
 
@@ -785,7 +794,7 @@
   }
 
   if(sb_verbose)
-    fprintf(stderr,"\r%s: loaded.                 \n",path);
+    fprintf(stderr,"\rLoading %s: loaded.         ",pcm->name);
 
   return pcm;
  err:
@@ -854,6 +863,9 @@
     return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT;
   }
 
+  if(sb_verbose)
+    fprintf(stderr,"\rLoading %s: parsing...      ",pcm->name);
+
   {
     float *d = (float *)pcm->data;
     int shift = pcm->nativebits - bits_per_sample;
@@ -1000,7 +1012,8 @@
   }
 
   if(sb_verbose)
-    fprintf(stderr,"\r%s: loaded.                 \n",path);
+    fprintf(stderr,"\rLoading %s: loaded.         ",pcm->name);
+
   return pcm;
  err:
   return NULL;
@@ -1116,7 +1129,8 @@
   ov_clear(&vf);
 
   if(sb_verbose)
-    fprintf(stderr,"\r%s: loaded.                 \n",path);
+    fprintf(stderr,"\rLoading %s: loaded.         ",pcm->name);
+
   return pcm;
  err:
   ov_clear(&vf);
@@ -1244,7 +1258,8 @@
   op_free(of);
 
   if(sb_verbose)
-    fprintf(stderr,  "\r%s: loaded.                          \n",path);
+    fprintf(stderr,"\rLoading %s: loaded.         ",pcm->name);
+
   return pcm;
  err:
   op_free(of);



More information about the commits mailing list