[xiph-cvs] cvs commit: ices/src im_oss.c im_playlist.c im_stdinpcm.c im_sun.c input.c
Michael Smith
msmith at xiph.org
Sat Aug 3 08:05:40 PDT 2002
msmith 02/08/03 08:05:40
Modified: src im_oss.c im_playlist.c im_stdinpcm.c im_sun.c
input.c
Log:
Some minor cleanups, and a fix for a segfault at the end of a playlist,
from Karl Heyes
Revision Changes Path
1.6 +3 -1 ices/src/im_oss.c
Index: im_oss.c
===================================================================
RCS file: /usr/local/cvsroot/ices/src/im_oss.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- im_oss.c 2001/10/21 02:10:08 1.5
+++ im_oss.c 2002/08/03 15:05:38 1.6
@@ -1,7 +1,7 @@
/* im_oss.c
* - Raw PCM input from OSS devices
*
- * $Id: im_oss.c,v 1.5 2001/10/21 02:10:08 jack Exp $
+ * $Id: im_oss.c,v 1.6 2002/08/03 15:05:38 msmith Exp $
*
* Copyright (c) 2001 Michael Smith <msmith at labyrinth.net.au>
*
@@ -115,6 +115,8 @@
im_oss_state *s = self;
rb->buf = malloc(BUFSIZE*2*s->channels);
+ if(!rb->buf)
+ return -1;
result = read(s->fd, rb->buf, BUFSIZE*2*s->channels);
rb->len = result;
<p><p>1.6 +3 -1 ices/src/im_playlist.c
Index: im_playlist.c
===================================================================
RCS file: /usr/local/cvsroot/ices/src/im_playlist.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- im_playlist.c 2002/07/07 11:07:55 1.5
+++ im_playlist.c 2002/08/03 15:05:38 1.6
@@ -1,7 +1,7 @@
/* playlist.c
* - Basic playlist functionality
*
- * $Id: im_playlist.c,v 1.5 2002/07/07 11:07:55 msmith Exp $
+ * $Id: im_playlist.c,v 1.6 2002/08/03 15:05:38 msmith Exp $
*
* Copyright (c) 2001 Michael Smith <msmith at labyrinth.net.au>
*
@@ -111,6 +111,8 @@
}
newfn = pl->get_filename(pl->data);
+ if(!newfn)
+ return -1; /* No more files available */
if(pl->filename && !strcmp(pl->filename, newfn))
{
<p><p>1.3 +4 -1 ices/src/im_stdinpcm.c
Index: im_stdinpcm.c
===================================================================
RCS file: /usr/local/cvsroot/ices/src/im_stdinpcm.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- im_stdinpcm.c 2001/09/25 12:04:21 1.2
+++ im_stdinpcm.c 2002/08/03 15:05:38 1.3
@@ -1,7 +1,7 @@
/* im_stdinpcm.c
* - Raw PCM input from stdin
*
- * $Id: im_stdinpcm.c,v 1.2 2001/09/25 12:04:21 msmith Exp $
+ * $Id: im_stdinpcm.c,v 1.3 2002/08/03 15:05:38 msmith Exp $
*
* Copyright (c) 2001 Michael Smith <msmith at labyrinth.net.au>
*
@@ -67,6 +67,9 @@
stdinpcm_state *s = self;
rb->buf = malloc(BUFSIZE);
+ if(!rb->buf)
+ return -1;
+
result = fread(rb->buf, 1,BUFSIZE, stdin);
rb->len = result;
<p><p>1.7 +3 -1 ices/src/im_sun.c
Index: im_sun.c
===================================================================
RCS file: /usr/local/cvsroot/ices/src/im_sun.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- im_sun.c 2001/10/21 10:20:31 1.6
+++ im_sun.c 2002/08/03 15:05:39 1.7
@@ -1,7 +1,7 @@
/* im_sun.c
* - Raw PCM input from Solaris audio devices
*
- * $Id: im_sun.c,v 1.6 2001/10/21 10:20:31 msmith Exp $
+ * $Id: im_sun.c,v 1.7 2002/08/03 15:05:39 msmith Exp $
*
* by Ciaran Anscomb <ciarana at rd.bbc.co.uk>, based
* on im_oss.c which is...
@@ -119,6 +119,8 @@
unsigned char *i, j;
rb->buf = malloc(BUFSIZE*2*s->device_info.record.channels);
+ if(!rb->buf)
+ return -1;
result = read(s->fd, rb->buf, BUFSIZE*2*s->device_info.record.channels);
rb->len = result;
<p><p>1.13 +6 -4 ices/src/input.c
Index: input.c
===================================================================
RCS file: /usr/local/cvsroot/ices/src/input.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- input.c 2002/01/23 03:40:28 1.12
+++ input.c 2002/08/03 15:05:39 1.13
@@ -2,7 +2,7 @@
* - Main producer control loop. Fetches data from input modules, and controls
* submission of these to the instance threads. Timing control happens here.
*
- * $Id: input.c,v 1.12 2002/01/23 03:40:28 jack Exp $
+ * $Id: input.c,v 1.13 2002/08/03 15:05:39 msmith Exp $
*
* Copyright (c) 2001 Michael Smith <msmith at labyrinth.net.au>
*
@@ -225,6 +225,7 @@
int shutdown = 0;
int current_module = 0;
int valid_stream = 1;
+ int inc_count;
while(ices_config->playlist_module && modules[current_module].open)
{
@@ -373,6 +374,8 @@
if(ret < 0)
valid_stream = 0;
+ inc_count = 0;
+
if(valid_stream)
{
while(instance)
@@ -389,9 +392,7 @@
queued->buf = chunk;
current = instance->queue;
- thread_mutex_lock(&ices_config->refcount_lock);
- chunk->count++;
- thread_mutex_unlock(&ices_config->refcount_lock);
+ inc_count++;
thread_mutex_lock(¤t->lock);
@@ -419,6 +420,7 @@
* if all threads are set to skip, for example).
*/
thread_mutex_lock(&ices_config->refcount_lock);
+ chunk->count += inc_count;
if(!chunk->count)
{
free(chunk->buf);
<p><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