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

Segher Boessenkool segher at xiph.org
Wed Feb 6 20:40:50 PST 2002



segher      02/02/06 20:40:49

  Modified:    ogg123   buffer.c callbacks.c
  Log:
  Some fixes to how audio writes are handled.
  
  Closes #127.

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

Index: buffer.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/ogg123/buffer.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- buffer.c	2002/01/26 11:06:37	1.15
+++ buffer.c	2002/02/07 04:40:49	1.16
@@ -11,7 +11,7 @@
  *                                                                  *
  ********************************************************************
 
- last mod: $Id: buffer.c,v 1.15 2002/01/26 11:06:37 segher Exp $
+ last mod: $Id: buffer.c,v 1.16 2002/02/07 04:40:49 segher Exp $
 
  ********************************************************************/
 
@@ -233,7 +233,7 @@
     /* No need to lock mutex here because the other thread will
        NEVER reduce the number of bytes stored in the buffer */
     DEBUG("Sending %d bytes to the audio device", write_amount);
-    buf->write_func(buf->buffer + buf->start, write_amount,
+    write_amount = buf->write_func(buf->buffer + buf->start, write_amount,
                     /* Only set EOS if this is the last chunk */
                     write_amount == buf->curfill ? buf->eos : 0,
                     buf->write_arg);

<p><p>1.5       +5 -1      vorbis-tools/ogg123/callbacks.c

Index: callbacks.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/ogg123/callbacks.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- callbacks.c	2002/01/26 11:06:37	1.4
+++ callbacks.c	2002/02/07 04:40:49	1.5
@@ -11,7 +11,7 @@
  *                                                                  *
  ********************************************************************
 
- last mod: $Id: callbacks.c,v 1.4 2002/01/26 11:06:37 segher Exp $
+ last mod: $Id: callbacks.c,v 1.5 2002/02/07 04:40:49 segher Exp $
 
  ********************************************************************/
 
@@ -31,7 +31,11 @@
   audio_play_arg_t *play_arg = (audio_play_arg_t *) arg;
   int ret;
 
+  pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);
+
   ret = audio_devices_write(play_arg->devices, ptr, nbytes);
+
+  pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
 
   return ret ? nbytes : 0;
 }

<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