[xiph-commits] r7376 - in icecast/trunk/ices0: conf doc src

brendan at dactyl.lonelymoon.com brendan
Tue Jul 27 13:07:07 PDT 2004


Author: brendan
Date: Tue Jul 27 13:07:07 2004
New Revision: 7376

Modified:
icecast/trunk/ices0/conf/ices.conf.dist.in
icecast/trunk/ices0/doc/ices.1.in
icecast/trunk/ices0/src/crossfade.c
icecast/trunk/ices0/src/ices_config.c
icecast/trunk/ices0/src/plugin.h
icecast/trunk/ices0/src/setup.c
Log:
Enable crossfader officially. It'll probably break if the input changes
PCM format, though.


Modified: icecast/trunk/ices0/conf/ices.conf.dist.in
===================================================================
--- icecast/trunk/ices0/conf/ices.conf.dist.in	2004-07-27 19:36:18 UTC (rev 7375)
+++ icecast/trunk/ices0/conf/ices.conf.dist.in	2004-07-27 20:07:06 UTC (rev 7376)
@@ -12,6 +12,10 @@
<!-- Module name to pass to the playlist handler if using  perl or python.
If you use the builtin playlist handler then this is ignored -->
<Module>ices</Module>
+    <!-- Set this to the number of seconds to crossfade between tracks.
+         Leave out or set to zero to disable crossfading (the default).
+    <Crossfade>5</Crossfade>
+    -->
</Playlist>

<Execution>

Modified: icecast/trunk/ices0/doc/ices.1.in
===================================================================
--- icecast/trunk/ices0/doc/ices.1.in	2004-07-27 19:36:18 UTC (rev 7375)
+++ icecast/trunk/ices0/doc/ices.1.in	2004-07-27 20:07:06 UTC (rev 7376)
@@ -1,4 +1,4 @@
-.TH "ices" "1" "July 2003" "ices @VERSION@" "Icecast media streaming system"
+.TH "ices" "1" "July 2004" "ices @VERSION@" "Icecast media streaming system"
.SH NAME
ices \- stream MP3 audio to an icecast server

@@ -18,6 +18,8 @@
.BR python \|| perl
.RB [\| \-M
.IR module \|]\|]
+.RB [\| \-C
+.IR crossfadesecs \|]
.\" Server options
.RB [\|[\| \-m
.IR mount \|]
@@ -68,6 +70,9 @@
files and reencode them on the fly as MP3, for the benefit of older
listening software.
.IP \(bu
+Crossfading between tracks. This is a new feature, and requires
+reencoding support.
+.IP \(bu
Multiple streams from the same playlist. In conjunction with
reencoding this gives you a very easy way to provide the same music
for broadband and narrowband listeners at the same time.
@@ -130,6 +135,11 @@
instead of the default,
.BR ices .
Otherwise this option does nothing.
+.TP
+.BI \-C \ crossfadesecs
+Crossfade between tracks. The length of the fade is
+.I crossfade
+seconds. This option requires reencoding support.

.SS "Stream options"
.TP

Modified: icecast/trunk/ices0/src/crossfade.c
===================================================================
--- icecast/trunk/ices0/src/crossfade.c	2004-07-27 19:36:18 UTC (rev 7375)
+++ icecast/trunk/ices0/src/crossfade.c	2004-07-27 20:07:06 UTC (rev 7376)
@@ -43,10 +43,12 @@
static int flen = 0;

/* public functions */
-ices_plugin_t *crossfade_plugin(void) {
-  FadeSamples = FadeSecs * 44100;
+ices_plugin_t *crossfade_plugin(int secs) {
+  FadeSamples = secs * 44100;
FL = malloc(FadeSamples * 2);
FR = malloc(FadeSamples * 2);
+  ices_log_debug("Crossfading %d seconds between tracks", secs);
+
return &Crossfader;
}


Modified: icecast/trunk/ices0/src/ices_config.c
===================================================================
--- icecast/trunk/ices0/src/ices_config.c	2004-07-27 19:36:18 UTC (rev 7375)
+++ icecast/trunk/ices0/src/ices_config.c	2004-07-27 20:07:06 UTC (rev 7376)
@@ -1,7 +1,7 @@
/* parse.c
* - Functions for xml file parsing
* Copyright (c) 2000 Alexander Haväng
- * Copyright (c) 2001-3 Brendan Cully
+ * Copyright (c) 2001-4 Brendan Cully
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -17,6 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
*
+ * $Id$
*/

#include "definitions.h"
@@ -253,6 +254,8 @@
static void
parse_playlist_node (xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, ices_config_t *ices_config)
{
+  int i;
+
for (; cur; cur = cur->next) {
if (cur->type == XML_COMMENT_NODE)
continue;
@@ -275,6 +278,9 @@
ices_util_free (ices_config->pm.module);
ices_config->pm.module =
ices_util_strdup (ices_xml_read_node (doc, cur));
+    } else if (strcmp (cur->name, "Crossfade") == 0) {
+      if ((i = atoi (ices_xml_read_node (doc, cur))) > 0)
+	ices_config->plugin = crossfade_plugin(i);
} else {
ices_log ("Unknown playlist keyword: %s", cur->name);
}

Modified: icecast/trunk/ices0/src/plugin.h
===================================================================
--- icecast/trunk/ices0/src/plugin.h	2004-07-27 19:36:18 UTC (rev 7375)
+++ icecast/trunk/ices0/src/plugin.h	2004-07-27 20:07:06 UTC (rev 7376)
@@ -31,6 +31,6 @@
struct _ices_plugin *next;
} ices_plugin_t;

-ices_plugin_t *crossfade_plugin(void);
+ices_plugin_t *crossfade_plugin(int secs);

#endif

Modified: icecast/trunk/ices0/src/setup.c
===================================================================
--- icecast/trunk/ices0/src/setup.c	2004-07-27 19:36:18 UTC (rev 7375)
+++ icecast/trunk/ices0/src/setup.c	2004-07-27 20:07:06 UTC (rev 7376)
@@ -79,9 +79,6 @@
#ifdef HAVE_LIBLAME
/* Initialize liblame for reeencoding */
ices_reencode_initialize ();
-  /*
-  ices_config.plugin = crossfade_plugin();
-  */
#endif
}

@@ -336,6 +333,10 @@
arg++;
stream->bitrate = atoi (argv[arg]);
break;
+        case 'C':
+	  arg++;
+	  if (atoi(argv[arg]) > 0)
+	    ices_config->plugin = crossfade_plugin(atoi(argv[arg]));
case 'c':
arg++;
break;



More information about the commits mailing list