Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix state of _wasPaused #380

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Fix state of _wasPaused #380

wants to merge 1 commit into from

Conversation

abcdev
Copy link

@abcdev abcdev commented Oct 19, 2017

if pause acts as play/pause toggle _wasPaused should get updated.

@muhku
Copy link
Owner

muhku commented Oct 23, 2017

What does this fix? I think the idea was that you keep track of the pause state in UI and call pause / play accordingly. Maybe not the most intuitive interface. Perhaps I could consider changing the implementation like this:

- (void)pause
{
    if (_wasPaused) {
         [self play];
    } else {
        _wasPaused = YES;
        _audioStream->pause();
    }
}

@abcdev
Copy link
Author

abcdev commented Oct 24, 2017

This fixes a "non restart" of a continuous stream if it was paused (is not anymore) and an audio interruption occurs (like siri). The value of _wasPaused is used only in line 766 and 959. But IMHO it doesn't make sense to handle it like this. why would someone not have his stream restarted after an audio interruption ? Why should my stream never attempt to restart? Remember that this is the behavior if you paused and resumed the stream at least once in the past. Thinking about that, this fix makes the _wasPaused a _isPaused.

if pause acts as play/pause toggle  _wasPaused should get updated.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants