[xiph-cvs] cvs commit: ices/src config.c config.h encode.c ices.c im_stdinpcm.c input.c
Michael Smith
msmith at xiph.org
Fri Feb 8 03:14:05 PST 2002
msmith 02/02/08 03:14:04
Modified: src Tag: branch-beta2-rewrite config.c config.h
encode.c ices.c im_stdinpcm.c input.c
Log:
Incremental commit to fix some minor bugs.
Revision Changes Path
No revision
<p>No revision
<p>1.6.2.2 +2 -3 ices/src/config.c
Index: config.c
===================================================================
RCS file: /usr/local/cvsroot/ices/src/config.c,v
retrieving revision 1.6.2.1
retrieving revision 1.6.2.2
diff -u -r1.6.2.1 -r1.6.2.2
--- config.c 2002/02/07 09:11:10 1.6.2.1
+++ config.c 2002/02/08 11:14:03 1.6.2.2
@@ -1,7 +1,7 @@
/* config.c
* - config file reading code, plus default settings.
*
- * $Id: config.c,v 1.6.2.1 2002/02/07 09:11:10 msmith Exp $
+ * $Id: config.c,v 1.6.2.2 2002/02/08 11:14:03 msmith Exp $
*
* Copyright (c) 2001-2002 Michael Smith <msmith at labyrinth.net.au>
*
@@ -257,10 +257,9 @@
} while ((node = node->next));
}
-void config_initialize(void)
+void config_initialise(void)
{
ices_config = (config_t *)calloc(1, sizeof(config_t));
- //_set_defaults(ices_config);
srand(time(NULL));
}
<p><p>1.10.2.2 +2 -2 ices/src/config.h
Index: config.h
===================================================================
RCS file: /usr/local/cvsroot/ices/src/config.h,v
retrieving revision 1.10.2.1
retrieving revision 1.10.2.2
diff -u -r1.10.2.1 -r1.10.2.2
--- config.h 2002/02/07 09:11:10 1.10.2.1
+++ config.h 2002/02/08 11:14:03 1.10.2.2
@@ -1,7 +1,7 @@
/* config.h
* - configuration, and global structures built from config
*
- * $Id: config.h,v 1.10.2.1 2002/02/07 09:11:10 msmith Exp $
+ * $Id: config.h,v 1.10.2.2 2002/02/08 11:14:03 msmith Exp $
*
* Copyright (c) 2001-2002 Michael Smith <msmith at labyrinth.net.au>
*
@@ -52,7 +52,7 @@
extern config_t *ices_config;
-void config_initialize(void);
+void config_initialise(void);
void config_shutdown(void);
int config_read(const char *filename);
<p><p>1.6.2.2 +14 -4 ices/src/encode.c
Index: encode.c
===================================================================
RCS file: /usr/local/cvsroot/ices/src/encode.c,v
retrieving revision 1.6.2.1
retrieving revision 1.6.2.2
diff -u -r1.6.2.1 -r1.6.2.2
--- encode.c 2002/02/07 09:11:10 1.6.2.1
+++ encode.c 2002/02/08 11:14:03 1.6.2.2
@@ -1,7 +1,7 @@
/* encode.c
* - runtime encoding of PCM data.
*
- * $Id: encode.c,v 1.6.2.1 2002/02/07 09:11:10 msmith Exp $
+ * $Id: encode.c,v 1.6.2.2 2002/02/08 11:14:03 msmith Exp $
*
* Copyright (c) 2001-2002 Michael Smith <msmith at labyrinth.net.au>
*
@@ -319,18 +319,28 @@
mod->priv_data = enc;
enc->managed = 0;
- enc->quality = 0.3;
+ enc->quality = 3.0;
enc->nom_br = 128000;
enc->min_br = enc->max_br = -1;
enc->max_page_time = 2.0; /* Seconds */
+ enc->serial = rand(); /* Start off at some random point */
while(params) {
if(!strcmp(params->name, "quality")) {
- /* FIXME: Ensure this is bounded to [0,10] */
enc->managed = 0;
- enc->quality = atof(params->value) * 0.1;
+ enc->quality = atof(params->value);
+ if(enc->quality < 0.0) {
+ LOG_WARN1("Cannot have quality value of %f, setting to 0",
+ enc->quality);
+ enc->quality = 0.0;
+ }
+ else if(enc->quality > 10.0) {
+ LOG_WARN1("Cannot have quality value of %f, setting to 10",
+ enc->quality);
+ enc->quality = 10.0;
+ }
}
else if(!strcmp(params->name, "nominal-bitrate")) {
enc->managed = 1;
<p><p>1.4.2.2 +2 -2 ices/src/ices.c
Index: ices.c
===================================================================
RCS file: /usr/local/cvsroot/ices/src/ices.c,v
retrieving revision 1.4.2.1
retrieving revision 1.4.2.2
diff -u -r1.4.2.1 -r1.4.2.2
--- ices.c 2002/02/07 09:11:11 1.4.2.1
+++ ices.c 2002/02/08 11:14:03 1.4.2.2
@@ -1,7 +1,7 @@
/* ices.c
* - Main startup, thread launching, and cleanup code.
*
- * $Id: ices.c,v 1.4.2.1 2002/02/07 09:11:11 msmith Exp $
+ * $Id: ices.c,v 1.4.2.2 2002/02/08 11:14:03 msmith Exp $
*
* Copyright (c) 2001-2002 Michael Smith <msmith at labyrinth.net.au>
*
@@ -44,7 +44,7 @@
log_initialize();
thread_initialize();
resolver_initialize();
- config_initialize();
+ config_initialise();
signals_setup();
<p><p>1.2.2.2 +2 -2 ices/src/im_stdinpcm.c
Index: im_stdinpcm.c
===================================================================
RCS file: /usr/local/cvsroot/ices/src/im_stdinpcm.c,v
retrieving revision 1.2.2.1
retrieving revision 1.2.2.2
diff -u -r1.2.2.1 -r1.2.2.2
--- im_stdinpcm.c 2002/02/07 09:11:11 1.2.2.1
+++ im_stdinpcm.c 2002/02/08 11:14:03 1.2.2.2
@@ -1,7 +1,7 @@
/* im_stdinpcm.c
* - Raw PCM input from stdin
*
- * $Id: im_stdinpcm.c,v 1.2.2.1 2002/02/07 09:11:11 msmith Exp $
+ * $Id: im_stdinpcm.c,v 1.2.2.2 2002/02/08 11:14:03 msmith Exp $
*
* Copyright (c) 2001-2002 Michael Smith <msmith at labyrinth.net.au>
*
@@ -85,7 +85,7 @@
if(rb->len <= 0)
{
- LOG_INFO0("Reached EOF, no more data available\n");
+ LOG_INFO0("Reached EOF, no more data available");
release_buffer(rb);
return -1;
}
<p><p>1.12.2.2 +21 -6 ices/src/input.c
Index: input.c
===================================================================
RCS file: /usr/local/cvsroot/ices/src/input.c,v
retrieving revision 1.12.2.1
retrieving revision 1.12.2.2
diff -u -r1.12.2.1 -r1.12.2.2
--- input.c 2002/02/07 09:11:11 1.12.2.1
+++ input.c 2002/02/08 11:14:03 1.12.2.2
@@ -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.2.1 2002/02/07 09:11:11 msmith Exp $
+ * $Id: input.c,v 1.12.2.2 2002/02/08 11:14:03 msmith Exp $
*
* Copyright (c) 2001-2002 Michael Smith <msmith at labyrinth.net.au>
*
@@ -81,7 +81,6 @@
ogg_packet op;
vorbis_info vi;
vorbis_comment vc;
- int ret = 0;
if(control->starttime == 0)
control->starttime = timing_get_time();
@@ -92,13 +91,20 @@
og.body = buf->buf + og.header_len;
if(control->serialno != ogg_page_serialno(&og)) {
+ LOG_DEBUG1("New ogg stream, serial %d", ogg_page_serialno(&og));
control->serialno = ogg_page_serialno(&og);
control->oldsamples = 0;
ogg_stream_init(&os, control->serialno);
- ogg_stream_pagein(&os, &og);
- ogg_stream_packetout(&os, &op);
+ if(ogg_stream_pagein(&os, &og)) {
+ LOG_ERROR0("Error submitting page to libogg");
+ goto fail;
+ }
+ if(ogg_stream_packetout(&os, &op)) {
+ LOG_ERROR0("Error retrieving packet from libogg");
+ goto fail;
+ }
vorbis_info_init(&vi);
vorbis_comment_init(&vc);
@@ -108,7 +114,7 @@
LOG_ERROR0("Timing control: can't determine sample rate for input, "
"not vorbis.");
control->samplerate = 0;
- ret = -1;
+ goto fail;
}
else {
control->samplerate = vi.rate;
@@ -127,7 +133,13 @@
control->senttime += ((double)control->samples * 1000000 /
(double)control->samplerate);
- return ret;
+ return 0;
+
+fail:
+ vorbis_comment_clear(&vc);
+ vorbis_info_clear(&vi);
+ ogg_stream_clear(&os);
+ return -1;
}
void input_flush_queue(buffer_queue *queue, int keep_critical)
@@ -202,6 +214,9 @@
process_chain_element *chain;
int shutdown = 0;
int valid_stream = 1;
+
+ control->serialno = -1; /* FIXME: Ideally, we should use a flag here - this
+ is otherwise a valid serial number */
thread_cond_create(&ices_config->queue_cond);
thread_cond_create(&ices_config->event_pending_cond);
<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