Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
W
wireplumber
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pkg
wireplumber
Commits
8e87bd32
Commit
8e87bd32
authored
4 years ago
by
George Kiagiadakis
Browse files
Options
Downloads
Patches
Plain Diff
core: fix disconnecting when pipewire quits
parent
21f63096
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/wp/core.c
+28
-5
28 additions, 5 deletions
lib/wp/core.c
with
28 additions
and
5 deletions
lib/wp/core.c
+
28
−
5
View file @
8e87bd32
...
...
@@ -158,9 +158,32 @@ core_done (void *data, uint32_t id, int seq)
g_task_return_boolean
(
task
,
TRUE
);
}
static
gboolean
core_disconnect_async
(
WpCore
*
self
)
{
wp_core_disconnect
(
self
);
return
G_SOURCE_REMOVE
;
}
static
void
core_error
(
void
*
data
,
uint32_t
id
,
int
seq
,
int
res
,
const
char
*
message
)
{
WpCore
*
self
=
WP_CORE
(
data
);
wp_warning_object
(
self
,
"error id:%u seq:%d res:%d (%s): %s"
,
id
,
seq
,
res
,
spa_strerror
(
res
),
message
);
/* protocol socket disconnected; schedule disconnecting our core */
if
(
id
==
0
&&
res
==
-
EPIPE
)
{
wp_core_idle_add_closure
(
self
,
NULL
,
g_cclosure_new_object
(
G_CALLBACK
(
core_disconnect_async
),
G_OBJECT
(
self
)));
}
}
static
const
struct
pw_core_events
core_events
=
{
PW_VERSION_CORE_EVENTS
,
.
done
=
core_done
,
.
error
=
core_error
,
};
static
void
...
...
@@ -168,8 +191,7 @@ proxy_core_destroy (void *data)
{
WpCore
*
self
=
WP_CORE
(
data
);
self
->
pw_core
=
NULL
;
/* Emit the disconnected signal */
wp_debug_object
(
self
,
"emit disconnected"
);
g_signal_emit
(
self
,
signals
[
SIGNAL_DISCONNECTED
],
0
);
}
...
...
@@ -437,10 +459,11 @@ void
wp_core_disconnect
(
WpCore
*
self
)
{
wp_registry_detach
(
&
self
->
registry
);
g_clear_pointer
(
&
self
->
pw_core
,
pw_core_disconnect
);
/* Emit the disconnected signal */
g_signal_emit
(
self
,
signals
[
SIGNAL_DISCONNECTED
],
0
);
/* pw_core_disconnect destroys the core proxy
and we continue in proxy_core_destroy() */
if
(
self
->
pw_core
)
pw_core_disconnect
(
self
->
pw_core
);
}
/**
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment