mirror of https://github.com/mpv-player/mpv
ao_pipewire: fix removal of zeroed hooks on old pipewire
Older versions of pipewire segfault when calling spa_hook_remove() on hooks that are zeroed. Add a backfill for the logic added by pipewire 0.3.57. Being able to remove zeroed hooks makes errorhandling much easier. See #11309
This commit is contained in:
parent
16ef237da5
commit
c3f326bc13
|
@ -55,6 +55,11 @@ static inline int pw_stream_get_time_n(struct pw_stream *stream, struct pw_time
|
|||
}
|
||||
#endif
|
||||
|
||||
#if !PW_CHECK_VERSION(0, 3, 57)
|
||||
// Earlier versions segfault on zeroed hooks
|
||||
#define spa_hook_remove(hook) if ((hook)->link.prev) spa_hook_remove(hook)
|
||||
#endif
|
||||
|
||||
enum init_state {
|
||||
INIT_STATE_NONE,
|
||||
INIT_STATE_SUCCESS,
|
||||
|
|
Loading…
Reference in New Issue