Merge pull request #138 from alexolivan/dnas_passwords
Fixed SHOUTCast password #138
This commit is contained in:
commit
d3825f3e17
|
@ -133,11 +133,15 @@ ConfigSection :: addLine ( const char * line ) throw ( Exception )
|
||||||
|
|
||||||
std::string::size_type ix;
|
std::string::size_type ix;
|
||||||
std::string str( line);
|
std::string str( line);
|
||||||
|
std::string str2 ("password");
|
||||||
|
|
||||||
|
if ( (ix = str.find(str2)) == str.npos ) {
|
||||||
/* delete everything after the first # */
|
/* delete everything after the first # */
|
||||||
if ( (ix = str.find( '#')) != str.npos ) {
|
if ( (ix = str.find( '#')) != str.npos ) {
|
||||||
str.erase( ix);
|
str.erase( ix);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* eat up all white space from the front */
|
/* eat up all white space from the front */
|
||||||
if ( (ix = str.find_first_not_of( WHITE_SPACE_STR)) != str.npos ) {
|
if ( (ix = str.find_first_not_of( WHITE_SPACE_STR)) != str.npos ) {
|
||||||
str.erase( 0, ix);
|
str.erase( 0, ix);
|
||||||
|
@ -170,4 +174,3 @@ ConfigSection :: addLine ( const char * line ) throw ( Exception )
|
||||||
/* now add the new key / value pair */
|
/* now add the new key / value pair */
|
||||||
return add( key.c_str(), value.c_str());
|
return add( key.c_str(), value.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -792,7 +792,7 @@ DarkIce :: configShoutCast ( const Config & config,
|
||||||
FileSink * localDumpFile = 0;
|
FileSink * localDumpFile = 0;
|
||||||
bool fileAddDate = false;
|
bool fileAddDate = false;
|
||||||
const char * fileDateFormat = 0;
|
const char * fileDateFormat = 0;
|
||||||
BufferedSink * audioOut = 0;
|
AudioEncoder * encoder = 0;
|
||||||
int bufferSize = 0;
|
int bufferSize = 0;
|
||||||
|
|
||||||
str = cs->get( "sampleRate");
|
str = cs->get( "sampleRate");
|
||||||
|
@ -907,9 +907,7 @@ DarkIce :: configShoutCast ( const Config & config,
|
||||||
localDumpFile);
|
localDumpFile);
|
||||||
|
|
||||||
|
|
||||||
audioOut = new BufferedSink(audioOuts[u].socket.get(), bufferSize, 1);
|
encoder = new LameLibEncoder( audioOuts[u].server.get(),
|
||||||
audioOuts[u].encoder = new LameLibEncoder(
|
|
||||||
audioOut,
|
|
||||||
dsp.get(),
|
dsp.get(),
|
||||||
bitrateMode,
|
bitrateMode,
|
||||||
bitrate,
|
bitrate,
|
||||||
|
@ -918,6 +916,7 @@ DarkIce :: configShoutCast ( const Config & config,
|
||||||
channel,
|
channel,
|
||||||
lowpass,
|
lowpass,
|
||||||
highpass );
|
highpass );
|
||||||
|
audioOuts[u].encoder = new BufferedSink(encoder, bufferSize, dsp->getSampleSize());
|
||||||
|
|
||||||
encConnector->attach( audioOuts[u].encoder.get());
|
encConnector->attach( audioOuts[u].encoder.get());
|
||||||
#endif // HAVE_LAME_LIB
|
#endif // HAVE_LAME_LIB
|
||||||
|
|
|
@ -99,11 +99,15 @@ Config :: addLine ( const char * line ) throw ( Exception )
|
||||||
|
|
||||||
std::string::size_type ix;
|
std::string::size_type ix;
|
||||||
std::string str( line);
|
std::string str( line);
|
||||||
|
std::string str2 ("password");
|
||||||
|
|
||||||
|
if ( (ix = str.find(str2)) == str.npos ) {
|
||||||
/* delete everything after the first # */
|
/* delete everything after the first # */
|
||||||
if ( (ix = str.find( '#')) != str.npos ) {
|
if ( (ix = str.find( '#')) != str.npos ) {
|
||||||
str.erase( ix);
|
str.erase( ix);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* eat up all white space from the front */
|
/* eat up all white space from the front */
|
||||||
if ( (ix = str.find_first_not_of( WHITE_SPACE_STR)) != str.npos ) {
|
if ( (ix = str.find_first_not_of( WHITE_SPACE_STR)) != str.npos ) {
|
||||||
str.erase( 0, ix);
|
str.erase( 0, ix);
|
||||||
|
@ -162,5 +166,3 @@ Config :: read ( std::istream & is ) throw ( Exception )
|
||||||
addLine( line);
|
addLine( line);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue