From e043b8784f2832f01d2d49d01debd4f187f2c123 Mon Sep 17 00:00:00 2001 From: darkeye Date: Sat, 20 Jul 2002 10:59:00 +0000 Subject: [PATCH] added support for Ogg Vorbis 1.0, removed support for rc2 --- darkice/trunk/ChangeLog | 1 + darkice/trunk/configure.in | 17 --------------- darkice/trunk/man/darkice.cfg.5 | 4 ++-- darkice/trunk/src/DarkIce.cpp | 7 +++--- darkice/trunk/src/VorbisLibEncoder.cpp | 30 +++++++++++++------------- 5 files changed, 21 insertions(+), 38 deletions(-) diff --git a/darkice/trunk/ChangeLog b/darkice/trunk/ChangeLog index 85271b5..ca4e0a9 100644 --- a/darkice/trunk/ChangeLog +++ b/darkice/trunk/ChangeLog @@ -3,6 +3,7 @@ DarkIce 0.10 o added possibility to select constant, average and variable bit rate encoding modes with specifying encoding quality as well. thanks to Nicu Pavel + o added support for Ogg Vorbis 1.0 final, removed support for rc2 09-04-2002: DarkIce 0.9.1 released diff --git a/darkice/trunk/configure.in b/darkice/trunk/configure.in index bb362bb..16fc35d 100644 --- a/darkice/trunk/configure.in +++ b/darkice/trunk/configure.in @@ -102,23 +102,6 @@ else fi -dnl----------------------------------------------------------------------------- -dnl find out which vorbis libs to use: rc2 or rc3 -dnl----------------------------------------------------------------------------- -AC_ARG_WITH( vorbis-lib, -[ --with-vorbis-lib=VERSION use vorbis lib version rc2 or rc3 [rc3] ], - USE_VORBIS_LIB=${withval}, USE_VORBIS_LIB="rc3" ) - -if test "x${USE_VORBIS_LIB}" != "xrc2" -a "x${USE_VORBIS_LIB}" != "xrc3" ; then - AC_MSG_ERROR( [bad vorbis lib version specified: ${USE_VORBIS_LIB}]) -fi -if test "x${USE_VORBIS_LIB}" = "xrc2" ; then - AC_DEFINE( VORBIS_LIB_RC2, 1, [use vorbis library verison rc2]) -fi -if test "x${USE_VORBIS_LIB}" = "xrc3" ; then - AC_DEFINE( VORBIS_LIB_RC3, 1, [use vorbis library version rc3]) -fi - dnl make sure at least one of lame and vorbis present if test "x${LAME_LDFLAGS}" = "x" -a "x${VORBIS_LDFLAGS}" = "x" ; then AC_MSG_ERROR( [neither lame nor Ogg Vorbis configured]) diff --git a/darkice/trunk/man/darkice.cfg.5 b/darkice/trunk/man/darkice.cfg.5 index 96acd5a..9f012f2 100644 --- a/darkice/trunk/man/darkice.cfg.5 +++ b/darkice/trunk/man/darkice.cfg.5 @@ -201,8 +201,8 @@ abr bit rate modes are specified. .TP .I quality The quality of encoding a value between 0.0 .. 1.0 (e.g. 0.8), with 1.0 being -the highest quality. Use a value greater than 0.0. Only used when cbr or vbr -bit rate modes are specified. +the highest quality. Use a value greater than 0.0. Only used when vbr +bit rate mode is specified. .TP .I server The diff --git a/darkice/trunk/src/DarkIce.cpp b/darkice/trunk/src/DarkIce.cpp index 763e64c..c2bf526 100644 --- a/darkice/trunk/src/DarkIce.cpp +++ b/darkice/trunk/src/DarkIce.cpp @@ -410,10 +410,6 @@ DarkIce :: configIceCast2 ( const Config & config, throw Exception( __FILE__, __LINE__, "bitrate not specified for CBR encoding"); } - if ( quality == 0 ) { - throw Exception( __FILE__, __LINE__, - "quality not specified for CBR encoding"); - } } else if ( Util::strEq( str, "abr") ) { bitrateMode = AudioEncoder::abr; @@ -980,6 +976,9 @@ DarkIce :: run ( void ) throw ( Exception ) $Source$ $Log$ + Revision 1.28 2002/07/20 10:59:00 darkeye + added support for Ogg Vorbis 1.0, removed support for rc2 + Revision 1.27 2002/04/13 11:26:00 darkeye added cbr, abr and vbr setting feature with encoding quality diff --git a/darkice/trunk/src/VorbisLibEncoder.cpp b/darkice/trunk/src/VorbisLibEncoder.cpp index d3a3fc2..8a27f16 100644 --- a/darkice/trunk/src/VorbisLibEncoder.cpp +++ b/darkice/trunk/src/VorbisLibEncoder.cpp @@ -76,18 +76,21 @@ VorbisLibEncoder :: open ( void ) switch ( getOutBitrateMode() ) { case cbr: - case abr: -#ifdef VORBIS_LIB_RC3 - if ( (ret = vorbis_encode_init( &vorbisInfo, - getInChannel(), - getOutSampleRate(), - getOutBitrate() * 1000, - getOutBitrate() * 1000, - -1 )) ) { + ret = vorbis_encode_setup_managed( &vorbisInfo, + getInChannel(), + getOutSampleRate(), + -1, + getOutBitrate() * 1000, + -1) + || vorbis_encode_ctl( &vorbisInfo, OV_ECTL_RATEMANAGE_AVG, NULL) + || vorbis_encode_setup_init( &vorbisInfo); + if ( ret ) { throw Exception( __FILE__, __LINE__, "vorbis encode init error", ret); } -#else + break; + + case abr: if ( (ret = vorbis_encode_init( &vorbisInfo, getInChannel(), getOutSampleRate(), @@ -97,11 +100,9 @@ VorbisLibEncoder :: open ( void ) throw Exception( __FILE__, __LINE__, "vorbis encode init error", ret); } -#endif break; case vbr: - if ( (ret = vorbis_encode_init_vbr( &vorbisInfo, getInChannel(), getOutSampleRate(), @@ -263,11 +264,9 @@ VorbisLibEncoder :: vorbisBlocksOut ( void ) throw () ogg_page oggPage; vorbis_analysis( &vorbisBlock, &oggPacket); -#ifdef VORBIS_LIB_RC3 vorbis_bitrate_addblock( &vorbisBlock); while ( vorbis_bitrate_flushpacket( &vorbisDspState, &oggPacket) ) { -#endif ogg_stream_packetin( &oggStreamState, &oggPacket); @@ -284,9 +283,7 @@ VorbisLibEncoder :: vorbisBlocksOut ( void ) throw () oggPage.header_len + oggPage.body_len - written); } } -#ifdef VORBIS_LIB_RC3 } -#endif } } @@ -319,6 +316,9 @@ VorbisLibEncoder :: close ( void ) throw ( Exception ) $Source$ $Log$ + Revision 1.10 2002/07/20 10:59:00 darkeye + added support for Ogg Vorbis 1.0, removed support for rc2 + Revision 1.9 2002/05/28 12:35:41 darkeye code cleanup: compiles under gcc-c++ 3.1, using -pedantic option