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

Stan Seibert volsung at xiph.org
Thu Nov 1 18:51:48 PST 2001



volsung     01/11/01 18:51:48

  Modified:    ogg123   Tag: volsung_kc_20011011 ogg123.c
  Log:
  Don't play sound when a hole is encountered in the stream.

Revision  Changes    Path
No                   revision

No                   revision

1.39.2.30.2.7 +21 -20    vorbis-tools/ogg123/ogg123.c

Index: ogg123.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/ogg123/ogg123.c,v
retrieving revision 1.39.2.30.2.6
retrieving revision 1.39.2.30.2.7
diff -u -r1.39.2.30.2.6 -r1.39.2.30.2.7
--- ogg123.c	2001/11/02 02:22:08	1.39.2.30.2.6
+++ ogg123.c	2001/11/02 02:51:47	1.39.2.30.2.7
@@ -14,7 +14,7 @@
  *                                                                  *
  ********************************************************************
 
- last mod: $Id: ogg123.c,v 1.39.2.30.2.6 2001/11/02 02:22:08 volsung Exp $
+ last mod: $Id: ogg123.c,v 1.39.2.30.2.7 2001/11/02 02:51:47 volsung Exp $
 
  ********************************************************************/
 
@@ -880,7 +880,7 @@
     eos = 0;    
     while (!eos && !sig_request.exit)
       {
-
+	
         /* Check signals */
         if (sig_request.skipfile) 
           {
@@ -913,7 +913,7 @@
           }
         else if (ret == OV_HOLE)
           {
-	    if (Options.statOpts.verbose > 1) 
+	    if (Options.statOpts.verbose > 1)
               /* we should be able to resync silently; if not there are 
                  bigger problems. */
               Error ("--- Hole in the stream; probably harmless\n");
@@ -929,7 +929,7 @@
             if (old_section != current_section && old_section != -1)
               eos = 1;
           }
-
+	
 
         /* Update bitrate display */
         Options.statOpts.stats[4].arg.doublearg = 
@@ -938,26 +938,27 @@
 
         /* Write audio data block to output, skipping or repeating chunks
            as needed */
-	do
+	if (ret > 0)
           {
-	    if (nthc-- == 0) 
+	    do
               {
-		if (Options.outputOpts.buffer)
+		if (nthc-- == 0) 
                   {
-		    buffer_submit_data (Options.outputOpts.buffer, 
-					convbuffer, ret, 1);
-		    UpdateStats();
+		    if (Options.outputOpts.buffer)
+		      {
+			buffer_submit_data (Options.outputOpts.buffer, 
+					    convbuffer, ret, 1);
+			UpdateStats();
+		      }
+		    else
+		      OutBufferWrite (convbuffer, ret, 1, &Options, 0);
+		    
+		    nthc = Options.playOpts.nth - 1;
                   }
-		else
-		  OutBufferWrite (convbuffer, ret, 1, &Options, 0);
-		
-		nthc = Options.playOpts.nth - 1;
-	      }
-	  } 
-	while (++ntimesc < Options.playOpts.ntimes);
-
-	ntimesc = 0;
-	
+	      } 
+	    while (++ntimesc < Options.playOpts.ntimes);
+	    ntimesc = 0;
+	  }
       } /* End of data loop */
     
     /* Done playing this logical bitstream.  Now we cleanup output buffer. */

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