Fixed SHOUTCast password

- Darkice.cpp configShoutcast part is returned as it was on commit 710d2c26c4 . This makes DNAS 1.9.8 to work again.
- Added suggested code patches to code at DarkiceConfig.cpp and Config.cpp by Yahoosam on issu #121. So DNAS2.x now can get stream IDs
This commit is contained in:
Alejandro Olivan Alvarez 2018-07-06 12:39:17 +02:00
parent 8f52426a7e
commit ad68e8dce2
3 changed files with 44 additions and 40 deletions

View File

@ -133,11 +133,15 @@ ConfigSection :: addLine ( const char * line ) throw ( Exception )
std::string::size_type ix;
std::string str( line);
std::string str2 ("password");
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

@ -99,11 +99,15 @@ Config :: addLine ( const char * line ) throw ( Exception )
std::string::size_type ix;
std::string str( line);
std::string str2 ("password");
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);
}
}