Skip to content

Commit

Permalink
Don't send an empty codec field in case of default ISO-8859-1, remove…
Browse files Browse the repository at this point in the history
… the related warning
  • Loading branch information
daschuer committed Mar 14, 2019
1 parent 9921c2e commit 0a9e68b
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions src/engine/sidechain/shoutconnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,17 +186,19 @@ void ShoutConnection::updateFromPreferences() {
// strings to pass to libshout.

QString codec = m_pProfile->getMetadataCharset();
QByteArray baCodec = codec.toLatin1();
m_pTextCodec = QTextCodec::codecForName(baCodec);
if (!m_pTextCodec) {
kLogger.warning()
<< "Couldn't find broadcast metadata codec for codec:" << codec
<< " defaulting to ISO-8859-1.";
if (!codec.isEmpty()) {
QByteArray baCodec = codec.toLatin1();
m_pTextCodec = QTextCodec::codecForName(baCodec);
if (!m_pTextCodec) {
kLogger.warning()
<< "Couldn't find broadcast metadata codec for codec:" << codec
<< " defaulting to ISO-8859-1.";
} else {
// Indicates our metadata is in the provided charset.
insertMetaData("charset", baCodec.constData());
}
}

// Indicates our metadata is in the provided charset.
shout_metadata_add(m_pShoutMetaData, "charset", baCodec.constData());

QString serverType = m_pProfile->getServertype();

QString host = m_pProfile->getHost();
Expand Down

0 comments on commit 0a9e68b

Please sign in to comment.