[xiph-cvs] cvs commit: vorbis-tools/ogg123 buffer.c ogg123.c

Kenneth C. Arnold kcarnold at xiph.org
Fri Aug 31 08:18:54 PDT 2001



kcarnold    01/08/31 08:18:54

  Modified:    ogg123   Tag: kcarnold_work buffer.c ogg123.c
  Log:
  Fix one compiler warning, change a lot of the error status messenging
  to hopefully make it more clear that an error occurred. Also some
  ASCII art for the file names; haven't decided if I like it or not.

Revision  Changes    Path
No                   revision

No                   revision

1.7.2.21  +2 -2      vorbis-tools/ogg123/buffer.c

Index: buffer.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/ogg123/buffer.c,v
retrieving revision 1.7.2.20
retrieving revision 1.7.2.21
diff -u -r1.7.2.20 -r1.7.2.21
--- buffer.c	2001/08/29 00:20:44	1.7.2.20
+++ buffer.c	2001/08/31 15:18:53	1.7.2.21
@@ -11,7 +11,7 @@
  *                                                                  *
  ********************************************************************
 
- last mod: $Id: buffer.c,v 1.7.2.20 2001/08/29 00:20:44 kcarnold Exp $
+ last mod: $Id: buffer.c,v 1.7.2.21 2001/08/31 15:18:53 kcarnold Exp $
 
  ********************************************************************/
 
@@ -385,7 +385,7 @@
 
 void SubmitData (buf_t *buf, chunk *data, size_t size, size_t nmemb)
 {
-  int i, s, writeSize;
+  int i, s;
   size *= nmemb;
   for (i = 0; i < size; i += buf->OptimalWriteSize) {
     s = i + buf->OptimalWriteSize <= size ? buf->OptimalWriteSize : size - i;

1.39.2.26 +23 -23    vorbis-tools/ogg123/ogg123.c

Index: ogg123.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/ogg123/ogg123.c,v
retrieving revision 1.39.2.25
retrieving revision 1.39.2.26
diff -u -r1.39.2.25 -r1.39.2.26
--- ogg123.c	2001/08/23 01:52:54	1.39.2.25
+++ ogg123.c	2001/08/31 15:18:53	1.39.2.26
@@ -14,7 +14,7 @@
  *                                                                  *
  ********************************************************************
 
- last mod: $Id: ogg123.c,v 1.39.2.25 2001/08/23 01:52:54 kcarnold Exp $
+ last mod: $Id: ogg123.c,v 1.39.2.26 2001/08/31 15:18:53 kcarnold Exp $
 
  ********************************************************************/
 
@@ -97,7 +97,7 @@
     }
   else
     {
-      Error ("Parse error: %s on line %d of %s (%s)\n", ParseErr(pcode), lineno, filename, line);
+      Error ("=== Parse error: %s on line %d of %s (%s)\n", ParseErr(pcode), lineno, filename, line);
       return 0;
     }
 }
@@ -391,9 +391,8 @@
               char *tmp = strdup (optarg);
               ParseCode pcode = ParseLine (opts, tmp);
               if (pcode != parse_ok)
-		Error ("Error parsing config option from command line.\n"
-		       "Error: %s\n"
-		       "Option was: %s\n", ParseErr (pcode), optarg);
+		Error ("=== Error \"%s\" while parsing config option from command line.\n"
+		       "=== Option was: %s\n", ParseErr (pcode), optarg);
               free (tmp);
             }
           else {
@@ -406,7 +405,7 @@
         case 'd':
             temp_driver_id = ao_driver_id(optarg);
             if (temp_driver_id < 0) {
-		Error ("No such device %s.\n", optarg);
+		Error ("=== No such device %s.\n", optarg);
                 exit(1);
             }
             current = append_device(Options.outputOpts.devices, temp_driver_id, 
@@ -422,12 +421,12 @@
               free(current->filename);
               current->filename = strdup(optarg);
             } else {
-	      Error ("Driver %s is not a file output driver.\n",
+	      Error ("=== Driver %s is not a file output driver.\n",
                      info->short_name);
               exit(1);
             }
           } else {
-	    Error ("Cannot specify output file without specifying a driver.\n");
+	    Error ("=== Cannot specify output file without specifying a driver.\n");
             exit (1);
           }
           break;
@@ -439,7 +438,7 @@
             break;
         case 'o':
             if (optarg && !add_option(current_options, optarg)) {
-		Error ("Incorrect option format: %s.\n", optarg);
+		Error ("=== Incorrect option format: %s.\n", optarg);
                 exit(1);
             }
             break;
@@ -450,7 +449,7 @@
           Options.outputOpts.Prebuffer = atof (optarg);
           if (Options.outputOpts.Prebuffer < 0.0f || Options.outputOpts.Prebuffer > 100.0f)
             {
-	      Error ("Prebuffer value invalid. Range is 0-100, using nearest value.\n");
+	      Error ("--- Prebuffer value invalid. Range is 0-100, using nearest value.\n");
               Options.outputOpts.Prebuffer = Options.outputOpts.Prebuffer < 0.0f ? 0.0f : 100.0f;
             }
           break;
@@ -466,14 +465,15 @@
         case 'x':
           Options.playOpts.nth = atoi (optarg);
           if (Options.playOpts.nth == 0) {
-	    Error ("Cannot play every 0th chunk!\n");
+	    Error ("--- Cannot play every 0th chunk!\n");
             Options.playOpts.nth = 1;
           }
           break;
         case 'y':
           Options.playOpts.ntimes = atoi (optarg);
           if (Options.playOpts.ntimes == 0) {
-	    Error ("Cannot play every chunk 0 times. To do a test decode, use the null output driver.\n");
+	    Error ("--- Cannot play every chunk 0 times.\n"
+		   "--- To do a test decode, use the null output driver.\n");
             Options.playOpts.ntimes = 1;
           }
           break;
@@ -500,7 +500,7 @@
       if (Options.outputOpts.default_device) {
         temp_driver_id = ao_driver_id (Options.outputOpts.default_device);
         if (temp_driver_id < 0)
-	  Error ("Warning: driver %s specified in configuration file invalid.\n", Options.outputOpts.default_device);
+	  Error ("--- Driver %s specified in configuration file invalid.\n", Options.outputOpts.default_device);
       }
       
       if (temp_driver_id < 0) {
@@ -508,7 +508,7 @@
       }
       
       if (temp_driver_id < 0) {
-	Error ("Could not load default driver and no driver specified in config file. Exiting.\n");
+	Error ("=== Could not load default driver and no driver specified in config file. Exiting.\n");
         exit(1);
       }
 
@@ -646,7 +646,7 @@
   if (tmp < 10 && tmp + 2 < strlen(Options.playOpts.read_file) && !strncmp(Options.playOpts.read_file + tmp, "://", 3))
     {
       /* let's call this a URL. */
-      ShowMessage (1, 0, 1, "Playing from stream %s", Options.playOpts.read_file);
+      ShowMessage (1, 0, 1, "-=( Stream: %s )=-", Options.playOpts.read_file);
       VorbisfileCallbacks.read_func = StreamBufferRead;
       VorbisfileCallbacks.seek_func = StreamBufferSeek;
       VorbisfileCallbacks.close_func = StreamBufferClose;
@@ -655,7 +655,7 @@
       Options.inputOpts.URL = Options.playOpts.read_file;
       Options.inputOpts.buffer = InitStream (Options.inputOpts);
       if ((ov_open_callbacks (Options.inputOpts.buffer->data, &vf, NULL, 0, VorbisfileCallbacks)) < 0) {
-	Error ("Error: input not an Ogg Vorbis audio stream.\n");
+	Error ("=== Input not an Ogg Vorbis audio stream.\n");
         return;
       }
       Options.statOpts.stats[6].enabled = 1;
@@ -672,20 +672,20 @@
 #endif
       if (strcmp(Options.playOpts.read_file, "-"))
         {
-	  ShowMessage (1, 0, 1, "Playing from file %s.", Options.playOpts.read_file);
+	  ShowMessage (1, 0, 1, "-=( File: %s )=-", Options.playOpts.read_file);
           /* Open the file. */
           if ((InStream = fopen(Options.playOpts.read_file, "rb")) == NULL) {
-	    Error ("Error opening input file.\n");
-	    exit(1);
+	    perror ("=== Error opening input file");
+	    return;
           }
         }
       else
         {
-	  ShowMessage (1, 0, 1, "Playing from standard input.");
+	  ShowMessage (1, 0, 1, "-=( Standard Input )=- ");
           InStream = stdin;
         }
       if ((ov_open (InStream, &vf, NULL, 0)) < 0) {
-	Error ("Error: input not an Ogg Vorbis audio stream.\n");
+	Error ("=== Input not an Ogg Vorbis audio stream.\n");
         return;
       }
     }
@@ -783,10 +783,10 @@
           if (Options.statOpts.verbose > 1) 
             /* we should be able to resync silently; if not there are 
                bigger problems. */
-	    Error ("Warning: hole in the stream; probably harmless\n");
+	    Error ("--- Hole in the stream; probably harmless\n");
         } else if (ret < 0) {
           /* Stream error */
-	  Error ("Error: libvorbis reported a stream error.\n");
+	  Error ("=== Vorbis library reported a stream error.\n");
         } else {
           /* did we enter a new logical bitstream */
           if (old_section != current_section && old_section != -1)

--- >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