Use shared_ptr for oboe stream (as rec. by google)

This commit is contained in:
badaix 2020-06-12 13:48:56 +02:00
parent 0a9031834f
commit 3077500f24
2 changed files with 2 additions and 2 deletions

View file

@ -61,7 +61,7 @@ OboePlayer::OboePlayer(boost::asio::io_context& io_context, const ClientSettings
//->setFramesPerCallback((8 * stream->getFormat().rate) / 1000)
//->setFramesPerCallback(2 * oboe::DefaultStreamValues::FramesPerBurst)
//->setFramesPerCallback(960) // 2*192)
->openManagedStream(out_stream_);
->openStream(out_stream_);
LOG(INFO, LOG_TAG) << "BufferSizeInFrames: " << out_stream_->getBufferSizeInFrames() << ", FramesPerBurst: " << out_stream_->getFramesPerBurst() << "\n";
if (result != oboe::Result::OK)
LOG(ERROR, LOG_TAG) << "Error building AudioStream: " << oboe::convertToText(result) << "\n";

View file

@ -45,7 +45,7 @@ protected:
double getCurrentOutputLatencyMillis() const;
bool needsThread() const override;
oboe::ManagedStream out_stream_;
std::shared_ptr<oboe::AudioStream> out_stream_;
std::unique_ptr<oboe::LatencyTuner> mLatencyTuner;
};