mirror of
https://github.com/badaix/snapcast.git
synced 2025-05-11 16:16:42 +02:00
parse sample format in Android
This commit is contained in:
parent
f0a71a9e94
commit
baf5a7af3b
2 changed files with 2 additions and 3 deletions
|
@ -352,7 +352,7 @@ public class MainActivity extends AppCompatActivity implements GroupItem.GroupIt
|
||||||
@Override
|
@Override
|
||||||
public void onLog(SnapclientService snapclientService, String timestamp, String logClass, String msg) {
|
public void onLog(SnapclientService snapclientService, String timestamp, String logClass, String msg) {
|
||||||
Log.d(TAG, "[" + logClass + "] " + msg);
|
Log.d(TAG, "[" + logClass + "] " + msg);
|
||||||
if ("state".equals(logClass)) {
|
if ("Notice".equals(logClass)) {
|
||||||
if (msg.startsWith("sampleformat")) {
|
if (msg.startsWith("sampleformat")) {
|
||||||
msg = msg.substring(msg.indexOf(":") + 2);
|
msg = msg.substring(msg.indexOf(":") + 2);
|
||||||
Log.d(TAG, "sampleformat: " + msg);
|
Log.d(TAG, "sampleformat: " + msg);
|
||||||
|
|
|
@ -115,8 +115,7 @@ void Controller::onMessageReceived(ClientConnection* connection, const msg::Base
|
||||||
throw SnapException("codec not supported: \"" + headerChunk_->codec + "\"");
|
throw SnapException("codec not supported: \"" + headerChunk_->codec + "\"");
|
||||||
|
|
||||||
sampleFormat_ = decoder_->setHeader(headerChunk_.get());
|
sampleFormat_ = decoder_->setHeader(headerChunk_.get());
|
||||||
/// TODO: read in Android client
|
LOG(NOTICE) << TAG("state") << "sampleformat: " << sampleFormat_.rate << ":" << sampleFormat_.bits << ":" << sampleFormat_.channels << "\n";
|
||||||
LOG(INFO) << TAG("state") << "sampleformat: " << sampleFormat_.rate << ":" << sampleFormat_.bits << ":" << sampleFormat_.channels << "\n";
|
|
||||||
|
|
||||||
stream_ = make_shared<Stream>(sampleFormat_);
|
stream_ = make_shared<Stream>(sampleFormat_);
|
||||||
stream_->setBufferLen(serverSettings_->getBufferMs() - latency_);
|
stream_->setBufferLen(serverSettings_->getBufferMs() - latency_);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue