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

Jack Moffitt jack at xiph.org
Mon Oct 30 13:33:05 PST 2000



jack        00/10/30 13:33:05

  Modified:    ogg123   ogg123.c
  Log:
  updated ogg123 for new error codes

Revision  Changes    Path
1.7       +9 -8      vorbis-tools/ogg123/ogg123.c

Index: ogg123.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/ogg123/ogg123.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- ogg123.c	2000/10/30 17:19:59	1.6
+++ ogg123.c	2000/10/30 21:33:05	1.7
@@ -14,7 +14,7 @@
  *                                                                  *
  ********************************************************************
 
- last mod: $Id: ogg123.c,v 1.6 2000/10/30 17:19:59 jack Exp $
+ last mod: $Id: ogg123.c,v 1.7 2000/10/30 21:33:05 jack Exp $
 
  ********************************************************************/
 
@@ -488,14 +488,15 @@
                 eos = 0;
                 while (!eos) {
                         old_section = current_section;
-			switch ((ret = ov_read (&vf, convbuffer, sizeof (convbuffer), is_big_endian, 2, 1, &current_section))) {
-			case 0: /* End of file */
+			ret = ov_read(&vf, convbuffer, sizeof (convbuffer), is_big_endian, 2, 1, &current_section);
+			if (ret == 0) {
+				/* End of file */
                                 eof = eos = 1;
-				break;
-			case -1: /* Stream error */
+			} else if (ret < 0) {
+				/* Stream error */
                                 fprintf(stderr, "W: Stream error\n");
-				break;
-			default: /* less bytes than we asked for */
+			} else {
+				/* less bytes than we asked for */
                                 /* did we enter a new logical bitstream */
                                 if (old_section != current_section && old_section != -1)
                                         eos = 1;
@@ -513,7 +514,7 @@
                 }
         }
 
-	ov_clear (&vf);
+	ov_clear(&vf);
       
         if (param.quiet < 1)
                 fprintf (stderr, "\nDone.\n");

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