From 21f3ad142e6bc99e98be1015a089b677a52a828f Mon Sep 17 00:00:00 2001 From: darkeye Date: Sun, 15 Feb 2004 12:14:38 +0000 Subject: [PATCH] added patch to allow mp3 stream downsampling to mono for icecast2 as well --- darkice/trunk/AUTHORS | 1 + darkice/trunk/ChangeLog | 3 +++ darkice/trunk/man/darkice.cfg.5 | 6 ++++++ darkice/trunk/src/DarkIce.cpp | 10 ++++++++-- 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/darkice/trunk/AUTHORS b/darkice/trunk/AUTHORS index 993179a..015cfcb 100644 --- a/darkice/trunk/AUTHORS +++ b/darkice/trunk/AUTHORS @@ -18,4 +18,5 @@ with contributions by: Ricardo Galli John Hay Christian Forster + John Deeny diff --git a/darkice/trunk/ChangeLog b/darkice/trunk/ChangeLog index b4fe178..55fde6a 100644 --- a/darkice/trunk/ChangeLog +++ b/darkice/trunk/ChangeLog @@ -2,6 +2,9 @@ DarkIce next release o added ALSA support, thanks to Christian Forster + o added fix to enable downsampling from stereo to mono of mp3 streams + when streaming to an icecast2 server. thanks to John Deeny + 07-01-2004: DarkIce 0.13.2 released diff --git a/darkice/trunk/man/darkice.cfg.5 b/darkice/trunk/man/darkice.cfg.5 index 736305a..62cc90f 100644 --- a/darkice/trunk/man/darkice.cfg.5 +++ b/darkice/trunk/man/darkice.cfg.5 @@ -239,6 +239,12 @@ Optional values: The sample rate of the encoded mp3 output. If not specified, defaults to the value of the input sample rate. .TP +.I channel +Number of channels for the mp3 output (e.g. 1 for mono, 2 for stereo). +If not specified, defaults to the value of the input sample rate. +Different channels for input and output are only supported for mp3, +but not for Ogg Vorbis. +.TP .I maxBitrate The maximum bitrate of the stream. Only used when in cbr mode and in Ogg Vorbis format. diff --git a/darkice/trunk/src/DarkIce.cpp b/darkice/trunk/src/DarkIce.cpp index d9a71f0..a5a99be 100644 --- a/darkice/trunk/src/DarkIce.cpp +++ b/darkice/trunk/src/DarkIce.cpp @@ -369,6 +369,7 @@ DarkIce :: configIceCast2 ( const Config & config, IceCast2::StreamFormat format; unsigned int sampleRate = 0; + unsigned int channel = 0; AudioEncoder::BitrateMode bitrateMode; unsigned int bitrate = 0; unsigned int maxBitrate = 0; @@ -398,7 +399,9 @@ DarkIce :: configIceCast2 ( const Config & config, str = cs->get( "sampleRate"); sampleRate = str ? Util::strToL( str) : dsp->getSampleRate(); - + str = cs->get( "channel"); + channel = str ? Util::strToL( str) : dsp->getChannel(); + // determine fixed bitrate or variable bitrate quality str = cs->get( "bitrate"); bitrate = str ? Util::strToL( str) : 0; @@ -505,7 +508,7 @@ DarkIce :: configIceCast2 ( const Config & config, bitrate, quality, sampleRate, - dsp->getChannel() ); + channel ); #endif // HAVE_LAME_LIB break; @@ -996,6 +999,9 @@ DarkIce :: run ( void ) throw ( Exception ) $Source$ $Log$ + Revision 1.37 2004/02/15 12:14:38 darkeye + added patch to allow mp3 stream downsampling to mono for icecast2 as well + Revision 1.36 2004/02/15 12:06:30 darkeye added ALSA support, thanks to Christian Forster