Repository navigation
fix: avoid crash on mute with vlc pipewire audio output - #328
Merged
Merged
Conversation
Owner
|
Thank you very much! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On Fedora (and anywhere else
vlc-plugin-pipewireis installed), VLC processes can die with SIGSEGV when a video is muted or its volume is changed. Every player is muted as soon as it is created (PlayerBase.init_player), so this can hit on startup.Cause
The crash is in the PipeWire audio output plugin:
The plugin's
Open()allocates its private struct withmallocand never setssys->stream. OnlyStart()(on the first audio frame) andStop()write it.MuteSet()andVolumeSet()checkif (sys->stream != NULL)and dereference it. So a mute or volume change before the first audio plays follows whatever the allocator left there.Waiting for "playing" before muting doesn't help. The output starts on the decoder thread, after that event, and a video without audio never starts it at all.
Seen with
vlc-3.0.23-1.fc43,vlc-plugin-pipewire-3-6.fc43,pipewire-1.4.11.Fix
On Linux, ask VLC for
--aout=pulse,any. On PipeWire desktops pulse is served by pipewire-pulse; on systems without a pulse server,,anyfalls back to whatever VLC would have picked. It goes before the options typed by hand in settings, so a user's own--aoutstill wins. The AppImage's existing--aout=pulseis unchanged.Reproduction
On Fedora 43 this segfaults on every run (5/5). With
--aout=pulse,anyit exits cleanly (5/5), and the PipeWire plugin is never loaded.Testing
tests/test_vlc_audio_output.py: pulse is asked for on Linux, a hand-typed--aoutstill wins, and other platforms are left alone.pyteston Python 3.14: everything passes except 5 tests that also fail onmasterin my environment (text eliding in the overlay tests, andtest_ytdl_js_runtimespicking up a container's/run/host). Not run on 3.10 locally.ruff check,ruff format --check,rumdl checkand pre-commit pass.