parse sample format in Android

This commit is contained in:
badaix 2017-10-04 23:13:47 +02:00
parent f0a71a9e94
commit baf5a7af3b
2 changed files with 2 additions and 3 deletions

View file

@ -352,7 +352,7 @@ public class MainActivity extends AppCompatActivity implements GroupItem.GroupIt
@Override
public void onLog(SnapclientService snapclientService, String timestamp, String logClass, String msg) {
Log.d(TAG, "[" + logClass + "] " + msg);
if ("state".equals(logClass)) {
if ("Notice".equals(logClass)) {
if (msg.startsWith("sampleformat")) {
msg = msg.substring(msg.indexOf(":") + 2);
Log.d(TAG, "sampleformat: " + msg);

View file

@ -115,8 +115,7 @@ void Controller::onMessageReceived(ClientConnection* connection, const msg::Base
throw SnapException("codec not supported: \"" + headerChunk_->codec + "\"");
sampleFormat_ = decoder_->setHeader(headerChunk_.get());
/// TODO: read in Android client
LOG(INFO) << TAG("state") << "sampleformat: " << sampleFormat_.rate << ":" << sampleFormat_.bits << ":" << sampleFormat_.channels << "\n";
LOG(NOTICE) << TAG("state") << "sampleformat: " << sampleFormat_.rate << ":" << sampleFormat_.bits << ":" << sampleFormat_.channels << "\n";
stream_ = make_shared<Stream>(sampleFormat_);
stream_->setBufferLen(serverSettings_->getBufferMs() - latency_);