Commits

Anonymous committed 7963fed

Misc changes here and there

Fix tutorials compile, make "ossmix toggle" a bit
more useful, make ossplay less noisy with '-qq', make ossrecord ignore '-O' so
scripts using it won't break, don't try to fclose(NULL) on one ossdetect error
path, and misc.

  • Participants
  • Parent commits 6bb7de5

Comments (0)

Files changed (9)

File cmd/ossmix/ossmix.c

         }
       if (relative & RELLEFT) lefti += left;
       if (relative & RELRIGHT) righti += right;
-      if (relative & RELTOGGLE) lefti = !left;
+      if (relative & RELTOGGLE) lefti = (left?0:extrec.maxvalue);
     }
 
   if (lefti < 0) lefti = 0;

File cmd/ossplay/ossplay.c

           dsp->reclevel = atoi (optarg);
           if (dsp->reclevel < 1 || dsp->reclevel > 100)
             {
-              print_msg (ERRORM, "%s: Bad recording level '%s'\n", argv[0],
-                         optarg);
+              print_msg (ERRORM, "%s: Bad recording level '%s'\n",
+                         argv[0]?argv[0]:"", optarg);
               exit (-1);
             }
           break;
           break;
 
         case 'w':
+        case 'O':
           break;
 
         case 'v':

File cmd/ossplay/ossplay.man

 -h		Display usage information.
 
 INTERRUPT
-Sending a SIGQUIT (Ctrl-\\ in most terminals) will make ossplay stop playing
+Sending a SIGQUIT (Ctrl-\e in most terminals) will make ossplay stop playing
 the currently played file and skip to the next file.
 
 NOTES

File cmd/ossplay/ossplay_console.c

 void
 perror_msg (const char * s)
 {
-  perror (s);
+  if (quiet < 2) perror (s);
 }
 
 void

File cmd/ossplay/ossplay_decode.c

         dec->decoder = decode_nul;
         dec->metadata = metadata;
         obsize = bsize;
-        if (metadata == NULL) return E_DECODE;
+        if (metadata == NULL) goto exit;
         else
           {
             ogg_data_t * val = (ogg_data_t *)metadata;
             print_msg (WARNM, "Converting to format %s\n",
                        sample_format_name (tmp));
             ret = setup_device (dsp, tmp, channels, speed);
+            if (ret == E_FORMAT_UNSUPPORTED) goto exit;
             decoders = setup_normalize (&format, &obsize, decoders);
             goto dcont;
           }
   unsigned char buf;
   fib_values_t * val;
 
+  if (read (fd, &buf, 1) <= 0) return NULL;
   val = (fib_values_t *)ossplay_malloc (sizeof (fib_values_t));
   if (format == AFMT_EXP_DELTA) val->table = CodeToExpDelta;
   else val->table = CodeToDelta;
 
-  if (read (fd, &buf, 1) <= 0) return NULL;
   val->pred = buf;
 
   return val;
   cradpcm_values_t * val;
   int i;
 
+  if (read (fd, &buf, 1) <= 0) return NULL;
   val = (cradpcm_values_t *)ossplay_malloc (sizeof (cradpcm_values_t));
   val->table = t_row;
 
       for (i=0; i < 2; i++) t_row[i] = T4[i];
     }
 
-  if (read (fd, &buf, 1) <= 0) return NULL;
   val->pred = buf;
 
   return val;

File os_cmd/FreeBSD/ossdetect/ossdetect.c

   if ((f = fopen ("/etc/oss.conf", "r")) == NULL)
     {
       perror ("/etc/oss.conf");
-      goto oexit;
+      goto oexit2;
     }
 
   while (fgets (tmp, sizeof (tmp), f) != NULL)
 		   "/usr/lib/oss\n");
 oexit:
   fclose (f);
+oexit2:
   snprintf (name, sizeof (name), "/usr/lib/oss");
   return name;
 }

File os_cmd/Linux/ossdetect/ossdetect.c

   if ((f = fopen ("/etc/oss.conf", "r")) == NULL)
     {
       perror ("/etc/oss.conf");
-      goto oexit;
+      goto oexit2;
     }
 
   while (fgets (tmp, sizeof (tmp), f) != NULL)
 		   "/usr/lib/oss\n");
 oexit:
   fclose (f);
+oexit2:
   snprintf (name, sizeof (name), "/usr/lib/oss");
   return name;
 }

File os_cmd/SCO_SV/ossdetect/ossdetect.c

   if ((f = fopen ("/etc/oss.conf", "r")) == NULL)
     {
       perror ("/etc/oss.conf");
-      goto oexit;
+      goto oexit2;
     }
 
   while (fgets (tmp, sizeof (tmp), f) != NULL)
 		   "/usr/lib/oss\n");
 oexit:
   fclose (f);
+oexit2:
   snprintf (name, sizeof (name), "/usr/lib/oss");
   return name;
 }

File tutorials/sndkit/sblive/asm10k.c

 static int ngpr = 0;
 
 static char *
-getline (char *buf, int len)
+agetline (char *buf, int len)
 {
   char *s;
 
 
   init_compiler ();
 
-  while (getline (iline, sizeof (iline) - 1) != NULL)
+  while (agetline (iline, sizeof (iline) - 1) != NULL)
     {
       if (*iline == '#')
 	{