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

Kenneth C. Arnold kcarnold at xiph.org
Fri Mar 23 18:31:39 PST 2001



kcarnold    01/03/23 18:31:39

  Modified:    ogg123   ogg123.c
  Log:
  Some random, minor cleanups, including making the OV_HOLE stream
  warning that bugs people using HTTP streaming be only displayed when
  we're being very verbose.

Revision  Changes    Path
1.31      +11 -7     vorbis-tools/ogg123/ogg123.c

Index: ogg123.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/ogg123/ogg123.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- ogg123.c	2001/02/24 00:52:22	1.30
+++ ogg123.c	2001/03/24 02:31:39	1.31
@@ -14,7 +14,7 @@
  *                                                                  *
  ********************************************************************
 
- last mod: $Id: ogg123.c,v 1.30 2001/02/24 00:52:22 jack Exp $
+ last mod: $Id: ogg123.c,v 1.31 2001/03/24 02:31:39 kcarnold Exp $
 
  ********************************************************************/
 
@@ -230,9 +230,9 @@
 void play_file(ogg123_options_t opt)
 {
     /* Oh my gosh this is disgusting. Big cleanups here will include an
-       almost complete rewrite of the hacked-out HTTP streaming, a shift
-       to using callbacks for the vorbisfile input, and a (mostly Unix-specific)
-       buffer. Probably use shm. */
+       almost complete rewrite of the hacked-out HTTP streaming and a shift
+       to using callbacks for the vorbisfile input.
+    */
 
     OggVorbis_File vf;
     int current_section = -1, eof = 0, eos = 0, ret;
@@ -388,11 +388,15 @@
             if (ret == 0) {
                 /* End of file */
                 eof = eos = 1;
+	    } else if (ret == OV_HOLE) {
+	      if (opt.verbose > 1) 
+		/* we should be able to resync silently; if not there are 
+		   bigger problems. */
+		fprintf (stderr, "Warning: hole in the stream; probably harmless\n");
             } else if (ret < 0) {
-		/* Stream error */
-		fprintf(stderr, "W: Stream error\n");
+	      /* Stream error */
+	      fprintf(stderr, "Error: libvorbis reported a stream error.\n");
             } else {
-		/* less bytes than we asked for */
                 /* did we enter a new logical bitstream */
                 if (old_section != current_section && old_section != -1)
                     eos = 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