Skip to content

Re-open stream when MMAP is disabled - #2338

Merged
madebymozart merged 2 commits into
mainfrom
madebymozart/bug-mmap-disabling
Jan 26, 2026
Merged

madebymozart merged 2 commits into
mainfrom
madebymozart/bug-mmap-disabling

Conversation

@madebymozart

Copy link
Copy Markdown
Collaborator

This fixes a bug where the stream would not restart if MMAP setting was changed

@madebymozart madebymozart self-assigned this Jan 26, 2026
// If the performance mode has changed, or if MMAP is disabled but currently used,
bool isMMapGlobal = isMMapEnabled();
bool isMMapCurrentlyUsed = OboeExtensions::isMMapUsed(mAudioStream.get());
if (performanceMode != mLastPerformanceMode || (!isMMapGlobal && isMMapCurrentlyUsed)) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may not be correct. If the mAudioStream is originally opened with mmap disabled and then the user reenable mmap, the stream should also be reopened.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes, just added the fix by making it global

@madebymozart
madebymozart merged commit 650dfef into main Jan 26, 2026
@madebymozart
madebymozart deleted the madebymozart/bug-mmap-disabling branch February 24, 2026 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants