Repository navigation
vlc-video: Keep a Stop in force when the next playlist item opens - #1037
Conversation
Pull request was closed
2e42a9c to
69eb0b6
Compare
|
Correction to my earlier comment: "Unable to open X display" is not evidence that Xvfb was unreachable. It is printed by |
…ng Qt (#1046) The Fast Gate's "Build Touched Linux Targets" step configured the tree without Qt, but plugins/frontend-tools is a core module that calls find_package(Qt6 REQUIRED Widgets). So every PR that touched a plugin failed at configure (#1031, #1037, #1016). Install the distro Qt packages for that step so configure passes. Only the touched non-Qt targets are built, and the Qt build and tests stay in the path-scoped Qt lane.
Pull request was closed
…ix) (obs-rust#1045) * test: Qt plugins opt out before requiring Qt (RED) The Fast Gate (obs-rust#1013) configures the touched Linux targets with no Qt. frontend-tools calls find_package(Qt6 REQUIRED) unconditionally, so that configure fails on every PR that builds C (obs-rust#1016, obs-rust#1031, obs-rust#1037). * frontend-tools: Skip the plugin when the frontend is off (GREEN) frontend-tools is frontend UI and requires Qt. Return before find_package(Qt6) when ENABLE_FRONTEND is OFF, as the AJA, DeckLink, VST and websocket plugins do with their own options, so the Fast Gate's Qt-free configure succeeds.
vlc-drain-gate.h factors the VLC source's drain_abort handling out with today's behavior: Stop signals the manual-reset event, and libVLC's Opening event (its event thread, also at a playlist boundary) resets it unconditionally. test_vlc_drain_gate drives the losing order directly: stop, then opened, then a wait, which must end at once. With the reset undoing the stop, the wait runs its full 2 s, as Stop near a track boundary does in the plugin. Refs #1011
…EEN) drain_abort (now struct vlc_drain_gate) cuts libVLC's audio waits short so libVLC's stop is not held up, but vlcs_started reset it on libvlc_MediaPlayerOpening, which fires on libVLC's event thread also at a playlist boundary. A Stop near a track end could be undone that way: the audio thread re-entered a pacing or drain wait (up to 3 s) and libVLC's stop waited behind it, so Stop took seconds and the source stayed PLAYING. A Stop (stop, restart, update, deactivate, destroy) now sets a pending flag that the Opening event respects; OBS starting playback (play, restart, update, activate, unpause) clears it. Next/previous only cut the wait short, as before. Fixes #1011
69eb0b6 to
2a116b9
Compare
libVLC 3's media list player moves on to the next playlist item on a thread of its own once the end of a track is reported. That move detaches and re-attaches the list player's end-of-track listener while holding only its callback lock, which libvlc_media_list_player_stop() also drops while it detaches the same listener. A Stop (or restart, settings update, deactivation, destruction, next or previous) that met the move lost the race in one of two ways: the move started the next item after the Stop, which left the source PLAYING with the Stop lost (the item then plays without audio pacing, since obs-rust#1037 keeps the drain gate open while a Stop is pending); or the second detach found no listener and libvlc_event_detach() called abort(), taking OBS down. The source now tracks the move: the end-of-track event marks it under way, and the list player's NextItemSet, Played and Stopped events mark it done. Before calling the list player, stop_playback() stops the media player, which ends the track's input thread and so any further end-of-track report, waits (up to 1 s) for a move under way to finish, and repeats that if the move started an item; the list player's stop then stops whatever the move started. Next and previous wait for a move under way too. An item that opens while a Stop is pending no longer emits media_started, and its audio is dropped. Headless, the new case: 6/6 pass in both libobs lanes (state STOPPED, no item started after the Stop), against 1 lost Stop and 5 aborts in 6 runs before. Fixes obs-rust#1677
libVLC 3's media list player moves on to the next playlist item on a thread of its own once the end of a track is reported. That move detaches and re-attaches the list player's end-of-track listener while holding only its callback lock, which libvlc_media_list_player_stop() also drops while it detaches the same listener. A Stop (or restart, settings update, deactivation, destruction, next or previous) that met the move lost the race in one of two ways: the move started the next item after the Stop, which left the source PLAYING with the Stop lost (the item then plays without audio pacing, since obs-rust#1037 keeps the drain gate open while a Stop is pending); or the second detach found no listener and libvlc_event_detach() called abort(), taking OBS down. The source now tracks the move: the end-of-track event marks it under way, and the list player's NextItemSet, Played and Stopped events mark it done. Before calling the list player, stop_playback() stops the media player, which ends the track's input thread and so any further end-of-track report, waits (up to 1 s) for a move under way to finish, and repeats that if the move started an item; the list player's stop then stops whatever the move started. Next and previous wait for a move under way too. An item that opens while a Stop is pending no longer emits media_started, and its audio is dropped. Headless, the new case: 6/6 pass in both libobs lanes (state STOPPED, no item started after the Stop), against 1 lost Stop and 5 aborts in 6 runs before. Fixes obs-rust#1677
…t#1678) * test: A VLC Stop as a playlist track ends must stay in force libVLC 3's media list player moves to the next item on its own thread after the end of a track is reported. stop_as_track_ends_stays_stopped issues a Stop from the "media_ended" handler and holds that report until the Stop is under way, so the Stop and the move to the next item meet, as a Stop pressed just as a track ends does. One second later the source must be stopped, and no item may have started after the Stop. On master the two meet inside libVLC: the move to the next item runs while the Stop has the end-of-track listener detached, so either the next item starts after the Stop (state PLAYING, the Stop is lost) or libvlc_event_detach() finds no listener to remove and calls abort(). Headless, 6 runs: 1 lost Stop and 5 aborts (SIGABRT, both libobs lanes). Refs obs-rust#1677 * vlc-video: Let libVLC's playlist move finish before stopping libVLC 3's media list player moves on to the next playlist item on a thread of its own once the end of a track is reported. That move detaches and re-attaches the list player's end-of-track listener while holding only its callback lock, which libvlc_media_list_player_stop() also drops while it detaches the same listener. A Stop (or restart, settings update, deactivation, destruction, next or previous) that met the move lost the race in one of two ways: the move started the next item after the Stop, which left the source PLAYING with the Stop lost (the item then plays without audio pacing, since obs-rust#1037 keeps the drain gate open while a Stop is pending); or the second detach found no listener and libvlc_event_detach() called abort(), taking OBS down. The source now tracks the move: the end-of-track event marks it under way, and the list player's NextItemSet, Played and Stopped events mark it done. Before calling the list player, stop_playback() stops the media player, which ends the track's input thread and so any further end-of-track report, waits (up to 1 s) for a move under way to finish, and repeats that if the move started an item; the list player's stop then stops whatever the move started. Next and previous wait for a move under way too. An item that opens while a Stop is pending no longer emits media_started, and its audio is dropped. Headless, the new case: 6/6 pass in both libobs lanes (state STOPPED, no item started after the Stop), against 1 lost Stop and 5 aborts in 6 runs before. Fixes obs-rust#1677
Fixes #1011.
Bug:
drain_abort(manual-reset event) cuts libVLC's audio pacing/drain waits short (up to 3 s each, on libVLC's audio thread) so libVLC's stop isn't held up.vlcs_startedreset it onlibvlc_MediaPlayerOpening, which libVLC fires on its event thread also when the next playlist item opens. Stopping near a track end could be undone: the audio thread re-entered a wait andlibvlc_media_list_player_stop_waited behind it, so Stop took seconds and the source stayed PLAYING. That'stest_vlc_playlist_gapstop_at_track_end_is_promptfailing withtook 2.068 s (state 1)in merge-group run 38850208674 (it removed #936 from the queue).RED (
test: A VLC Stop must survive the next item opening right after it):plugins/vlc-video/vlc-drain-gate.hfactors the event handling out with today's behavior;test_vlc_drain_gatedrives the losing order directly (stop, then opened, then a wait). Local Tier 2:test_stop_survives_the_next_item_openingfailed attest_vlc_drain_gate.c:39(the wait ran its full 2 s); the two cases that the waits still re-arm after play and after a next-item open passed.GREEN (
vlc-video: Keep a Stop in force when the next playlist item opens): a Stop (stop, restart, update, deactivate, destroy) sets a pending flag that the Opening event respects; OBS starting playback (play, restart, update, activate, unpause) clears it. Next/previous only cut the wait short, as before. The plugin uses the gate for every formerdrain_abortuse.Local Tier 2 (
--repeat 3 --tests 'test_vlc_drain_gate|test_vlc_playlist_gap'): OFF 256/256, both tests passing 3 more times each (stop_at_track_end_is_promptincluded, against real libVLC). ON: both pass; two unrelated failures,test_media_restart_stale_frame(#1032) and atest_v4l2_busy_signalcase whose setup failed on "Unable to open X display" (Xvfb dropping out under parallel tests, see #838).Note: an earlier local build of GREEN broke two braceless
ifbodies when the gate's play call was inserted (one failed to compile, the other compiled with wrong control flow); both are braced now and the full diff against master was reviewed line by line.