This is a major cleanup of core playback internals. Some important things to note:
The text was updated successfully, but these errors were encountered:
While trying to remove traces of stop calls in core to get gapless working I found we had no way to switch to switch tracks without triggering a play. This change fixes this by changing the backends playback provider API. - play() now _only_ starts playback and does not take any arguments. - prepare_change() has been added, this could have been avoided with a kwarg to change_track(track), but that would break more backends. - core has been updated to call prepare_change+change_track+play as needed. - tests have been updated to handle this change. Longer term I hope to completely rework the playback API in backends, as 99% of our backends only use change_track(track) to translate URIs. So we should make simple case simple, and handle mopidy-spotify / appsrc in some other way.
Note that since this doesn't use play via change_track we have to copy over the tracking code and make sure it is only run for the playing case
Same fix as for core.playback.next and mostly the same caveats.
Only handles the playing case, unlike the previous and next changes. It should also be noted that this is just a temporary state on the road to making this method handle gapless.
There is still quite a bit to be done is this area: - We need to start tracking pending tracks as there is time window when we are decoding a new track but still playing the old one - Currently this breaks seek, next, prev during this time window - The old on_end_of_track code needs to die. - Stream changes need to trigger playing events and switch the pending track to current.
- Adds stream changed handler to core - Moves playback started trigger to stream changed - Made about to finish store next track in _pending_tl_track - Set the pending track as current in stream changed - Adds tests for all of this and fixes existing tests
- Pending track should only be triggered by stream_changed if there is one. - Tracklist changed was incorrectly calling stop breaking tests and gapless - Tests have been updated to capture and replay audio events. This should avoid test deadlocks while still using the audio fakes.
Conflicts: mopidy/backend.py mopidy/commands.py mopidy/core/actor.py mopidy/core/playback.py tests/audio/test_actor.py tests/core/test_playback.py tests/local/test_playback.py
Conflicts: mopidy/commands.py mopidy/core/playback.py tests/core/test_playback.py tests/local/test_playback.py
This is no longer needed as the plain send method makes sure to use tell to queue actor message. Which has better performance, and avoids deadlocks. A side effect of this is that assuming you have a core actor running and a dummy audio in use audio events just work.
…ed in This is needed in order to make audio events propagate, to core and trigger async state changes in tests.
When about to finish gets called we are running in some GStreamer thread. Our audio code then calls the shim core callback which is responsible for transferring our execution to the core actor thread and waiting for the response. From this point we do normal actor calls to the backend(s) which in turn call into the audio actor. Since the initial audio code that was called is outside the actor this should never deadlock due to this loop.
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments.