[xiph-cvs] cvs commit: ices/src Makefile.am input.c stream.c
Michael Smith
msmith at xiph.org
Sun Aug 11 02:45:34 PDT 2002
msmith 02/08/11 05:45:34
Modified: src Makefile.am input.c stream.c
Log:
Better reconnect logic.
Revision Changes Path
1.9 +2 -2 ices/src/Makefile.am
Index: Makefile.am
===================================================================
RCS file: /usr/local/cvsroot/ices/src/Makefile.am,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- Makefile.am 3 Aug 2002 08:14:54 -0000 1.8
+++ Makefile.am 11 Aug 2002 09:45:34 -0000 1.9
@@ -37,8 +37,8 @@
GET = true
debug:
- $(MAKE) all CFLAGS="@DEBUG@ @XML_CFLAGS@ @OGG_CFLAGS@ @VORBIS_CFLAGS@ @SHOUT_CFLAGS@"
+ $(MAKE) all CFLAGS="@DEBUG@ @XML_CFLAGS@ @OGG_CFLAGS@ @VORBIS_CFLAGS@ @SHOUT_CFLAGS@"
profile:
- $(MAKE) all CFLAGS="@PROFILE@ @XML_CFLAGS@ @OGG_CFLAGS@ @VORBIS_CFLAGS@ @SHOUT_CFLAGS@"
+ $(MAKE) all CFLAGS="@PROFILE@ @XML_CFLAGS@ @OGG_CFLAGS@ @VORBIS_CFLAGS@ @SHOUT_CFLAGS@"
<p><p>1.17 +29 -3 ices/src/input.c
Index: input.c
===================================================================
RCS file: /usr/local/cvsroot/ices/src/input.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- input.c 10 Aug 2002 04:50:00 -0000 1.16
+++ input.c 11 Aug 2002 09:45:34 -0000 1.17
@@ -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.16 2002/08/10 04:50:00 msmith Exp $
+ * $Id: input.c,v 1.17 2002/08/11 09:45:34 msmith Exp $
*
* Copyright (c) 2001 Michael Smith <msmith at labyrinth.net.au>
*
@@ -225,6 +225,7 @@
int current_module = 0;
int valid_stream = 1;
int inc_count;
+ int not_waiting_for_critical;
while(ices_config->playlist_module && modules[current_module].open)
{
@@ -386,13 +387,22 @@
}
inc_count = 0;
+ not_waiting_for_critical = 0;
if(valid_stream)
{
while(instance)
{
- if(instance->skip ||
- (instance->wait_for_critical && !chunk->critical))
+ if(instance->wait_for_critical && !chunk->critical)
+ {
+ instance = instance->next;
+ continue;
+
+ }
+
+ not_waiting_for_critical = 1;
+
+ if(instance->skip)
{
instance = instance->next;
continue;
@@ -424,6 +434,22 @@
instance = instance->next;
}
+ }
+
+ /* If everything is waiting for a critical buffer, force one
+ * early. (This will take effect on the next pass through)
+ */
+ if(valid_stream && !not_waiting_for_critical) {
+ ices_config->inmod->handle_event(ices_config->inmod,
+ EVENT_NEXTTRACK,NULL);
+ instance = ices_config->instances;
+ while(instance) {
+ thread_mutex_lock(&ices_config->flush_lock);
+ input_flush_queue(instance->queue, 0);
+ instance->wait_for_critical = 0;
+ thread_mutex_unlock(&ices_config->flush_lock);
+ instance = instance->next;
+ }
}
/* Make sure we don't end up with a 0-refcount buffer that
<p><p>1.18 +11 -1 ices/src/stream.c
Index: stream.c
===================================================================
RCS file: /usr/local/cvsroot/ices/src/stream.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- stream.c 10 Aug 2002 04:50:00 -0000 1.17
+++ stream.c 11 Aug 2002 09:45:34 -0000 1.18
@@ -1,7 +1,7 @@
/* stream.c
* - Core streaming functions/main loop.
*
- * $Id: stream.c,v 1.17 2002/08/10 04:50:00 msmith Exp $
+ * $Id: stream.c,v 1.18 2002/08/11 09:45:34 msmith Exp $
*
* Copyright (c) 2001 Michael Smith <msmith at labyrinth.net.au>
*
@@ -245,6 +245,16 @@
LOG_INFO3("Connected to server: %s:%d%s",
shout_get_host(sdsc->shout), shout_get_port(sdsc->shout),
shout_get_mount(sdsc->shout));
+ /* This stream can't restart until the next
+ * logical stream comes along, since the
+ * server won't have any cached headers for
+ * this source/connection. So, don't continue
+ * yet.
+ */
+ thread_mutex_lock(&ices_config->flush_lock);
+ stream->wait_for_critical = 1;
+ input_flush_queue(stream->queue, 0);
+ thread_mutex_unlock(&ices_config->flush_lock);
break;
}
else
<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