FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Re-open stream when MMAP is disabled by madebymozart · Pull Request #2338 · google/oboe · GitHub

/ oboe Public
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .cpp  (1) .h  (1) All 2 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ void PowerPlayMultiPlayer::setupAudioStream(int32_t channelCount,
bool PowerPlayMultiPlayer::openStream(oboe::PerformanceMode performanceMode) {
__android_log_print(ANDROID_LOG_INFO, TAG, "openStream()");
mLastPerformanceMode = performanceMode;
mLastMMapEnabled = isMMapEnabled();

// Use shared_ptr to prevent use of a deleted callback.
mDataCallback = std::make_shared<MyDataCallback>(this);
Expand Down Expand Up @@ -132,7 +133,9 @@ void PowerPlayMultiPlayer::triggerDown(int32_t index, oboe::PerformanceMode perf
}

// If the performance mode has changed, we need to reopen the stream.
if (performanceMode != mLastPerformanceMode) {
// Also reopen if the user has changed the MMAP policy (enabled/disabled) since the stream was opened.
if (performanceMode != mLastPerformanceMode ||
isMMapEnabled() != mLastMMapEnabled) {
teardownAudioStream();

// Attempt here to reopen the stream with the new performance mode.
Expand Down
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ class PowerPlayMultiPlayer : public iolib::SimpleMultiPlayer {
std::shared_ptr<MyPresentationCallback> mPresentationCallback;

oboe::PerformanceMode mLastPerformanceMode;

bool mLastMMapEnabled;
};

#endif //SAMPLES_POWERPLAYMULTIPLAYER_H

Back | FazBrowse Home | New Git URL