Merge pull request #138 from alexolivan/dnas_passwords

Fixed SHOUTCast password #138
This commit is contained in:
rafael2k 2018-07-10 14:04:01 -03:00 committed by GitHub
commit d3825f3e17
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 44 additions and 40 deletions

View File

@ -132,12 +132,16 @@ ConfigSection :: addLine ( const char * line ) throw ( Exception )
}
std::string::size_type ix;
std::string str( line);
std::string str( line);
std::string str2 ("password");
/* delete everything after the first # */
if ( (ix = str.find( '#')) != str.npos ) {
str.erase( ix);
if ( (ix = str.find(str2)) == str.npos ) {
/* delete everything after the first # */
if ( (ix = str.find( '#')) != str.npos ) {
str.erase( ix);
}
}
/* eat up all white space from the front */
if ( (ix = str.find_first_not_of( WHITE_SPACE_STR)) != str.npos ) {
str.erase( 0, ix);
@ -170,4 +174,3 @@ ConfigSection :: addLine ( const char * line ) throw ( Exception )
/* now add the new key / value pair */
return add( key.c_str(), value.c_str());
}

View File

@ -792,7 +792,7 @@ DarkIce :: configShoutCast ( const Config & config,
FileSink * localDumpFile = 0;
bool fileAddDate = false;
const char * fileDateFormat = 0;
BufferedSink * audioOut = 0;
AudioEncoder * encoder = 0;
int bufferSize = 0;
str = cs->get( "sampleRate");
@ -907,9 +907,7 @@ DarkIce :: configShoutCast ( const Config & config,
localDumpFile);
audioOut = new BufferedSink(audioOuts[u].socket.get(), bufferSize, 1);
audioOuts[u].encoder = new LameLibEncoder(
audioOut,
encoder = new LameLibEncoder( audioOuts[u].server.get(),
dsp.get(),
bitrateMode,
bitrate,
@ -918,6 +916,7 @@ DarkIce :: configShoutCast ( const Config & config,
channel,
lowpass,
highpass );
audioOuts[u].encoder = new BufferedSink(encoder, bufferSize, dsp->getSampleSize());
encConnector->attach( audioOuts[u].encoder.get());
#endif // HAVE_LAME_LIB

View File

@ -98,12 +98,16 @@ Config :: addLine ( const char * line ) throw ( Exception )
}
std::string::size_type ix;
std::string str( line);
std::string str( line);
std::string str2 ("password");
/* delete everything after the first # */
if ( (ix = str.find( '#')) != str.npos ) {
str.erase( ix);
if ( (ix = str.find(str2)) == str.npos ) {
/* delete everything after the first # */
if ( (ix = str.find( '#')) != str.npos ) {
str.erase( ix);
}
}
/* eat up all white space from the front */
if ( (ix = str.find_first_not_of( WHITE_SPACE_STR)) != str.npos ) {
str.erase( 0, ix);
@ -162,5 +166,3 @@ Config :: read ( std::istream & is ) throw ( Exception )
addLine( line);
}
}