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

Stan Seibert volsung at xiph.org
Sat Jul 6 11:18:33 PDT 2002



volsung     02/07/06 11:18:33

  Modified:    ogg123   buffer.c
  Log:
  Ctrl-C during HTTP download now works correctly.  buffer_abort_write()
  aborts writes into or out of the buffer.

Revision  Changes    Path
1.18      +3 -2      vorbis-tools/ogg123/buffer.c

Index: buffer.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/ogg123/buffer.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- buffer.c	2002/06/02 03:07:10	1.17
+++ buffer.c	2002/07/06 18:18:32	1.18
@@ -11,7 +11,7 @@
  *                                                                  *
  ********************************************************************
 
- last mod: $Id: buffer.c,v 1.17 2002/06/02 03:07:10 volsung Exp $
+ last mod: $Id: buffer.c,v 1.18 2002/07/06 18:18:32 volsung Exp $
 
  ********************************************************************/
 
@@ -281,7 +281,7 @@
   pthread_cleanup_push(buffer_mutex_unlock, buf);
 
   /* Put the data into the buffer as space is made available */
-  while (size > 0) {
+  while (size > 0 && !buf->abort_write) {
     
     /* Section 1: Write a chunk of data */
     DEBUG("Obtaining lock on buffer");
@@ -605,6 +605,7 @@
 
   LOCK_MUTEX(buf->mutex);
   buf->abort_write = 1;
+  COND_SIGNAL(buf->write_cond);
   COND_SIGNAL(buf->playback_cond);
   UNLOCK_MUTEX(buf->mutex);  
 

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