Skip to content

Fix state of _wasPaused #380

Open
abcdev wants to merge 1 commit intomuhku:masterfrom
abcdev:master
Open

Fix state of _wasPaused #380
abcdev wants to merge 1 commit intomuhku:masterfrom
abcdev:master

Conversation

@abcdev
Copy link
Copy Markdown

@abcdev abcdev commented Oct 19, 2017

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

@muhku
Copy link
Copy Markdown
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
Copy Markdown
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