linux-pipewire: Version check call to pw_deinit
Per upstream this function is not supposed to be called by users of PipeWire, and will crash when called twice. Instead only call it on recent versions of PipeWire where it is safe to call. This also removes the nearly empty pipewire-common files.
This commit is contained in:
parent
255c4096a8
commit
bf660b1d8d
@ -33,8 +33,6 @@ add_library(OBS::pipewire ALIAS linux-pipewire)
|
||||
target_sources(
|
||||
linux-pipewire
|
||||
PRIVATE linux-pipewire.c
|
||||
pipewire-common.c
|
||||
pipewire-common.h
|
||||
pipewire.c
|
||||
pipewire.h
|
||||
pipewire-capture.c
|
||||
|
@ -22,7 +22,7 @@
|
||||
#include <obs-module.h>
|
||||
#include <obs-nix-platform.h>
|
||||
|
||||
#include "pipewire-common.h"
|
||||
#include <pipewire/pipewire.h>
|
||||
#include "pipewire-capture.h"
|
||||
|
||||
OBS_DECLARE_MODULE()
|
||||
@ -34,7 +34,7 @@ MODULE_EXPORT const char *obs_module_description(void)
|
||||
|
||||
bool obs_module_load(void)
|
||||
{
|
||||
obs_pipewire_load();
|
||||
pw_init(NULL, NULL);
|
||||
|
||||
// OBS PipeWire Screen Capture
|
||||
switch (obs_get_nix_platform()) {
|
||||
@ -53,5 +53,7 @@ bool obs_module_load(void)
|
||||
|
||||
void obs_module_unload(void)
|
||||
{
|
||||
obs_pipewire_unload();
|
||||
#if PW_CHECK_VERSION(0, 3, 49)
|
||||
pw_deinit();
|
||||
#endif
|
||||
}
|
||||
|
@ -1,33 +0,0 @@
|
||||
/* pipewire-common.c
|
||||
*
|
||||
* Copyright 2021 columbarius <co1umbarius@protonmail.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#include <pipewire/pipewire.h>
|
||||
|
||||
#include "pipewire-common.h"
|
||||
|
||||
void obs_pipewire_load(void)
|
||||
{
|
||||
pw_init(NULL, NULL);
|
||||
}
|
||||
|
||||
void obs_pipewire_unload(void)
|
||||
{
|
||||
pw_deinit();
|
||||
}
|
@ -1,24 +0,0 @@
|
||||
/* pipewire-common.h
|
||||
*
|
||||
* Copyright 2021 columbarius <co1umbarius@protonmail.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
void obs_pipewire_load(void);
|
||||
void obs_pipewire_unload(void);
|
Loading…
x
Reference in New Issue
Block a user