hook: return number of hooks called

Do finish_format ourselved when nobody was listening for the
format change.
This commit is contained in:
Wim Taymans 2018-03-14 11:17:51 +01:00
parent fb7a51c6e7
commit 8cadcd7f56
2 changed files with 13 additions and 4 deletions

View file

@ -800,6 +800,8 @@ client_node_port_set_param(void *data,
struct pw_type *t = &stream->remote->core->type;
if (id == t->param.idFormat) {
int count;
pw_log_debug("stream %p: format changed %d", stream, seq);
if (impl->format)
@ -814,9 +816,12 @@ client_node_port_set_param(void *data,
impl->pending_seq = seq;
spa_hook_list_call(&stream->listener_list,
struct pw_stream_events,
format_changed, impl->format);
count = spa_hook_list_call(&stream->listener_list,
struct pw_stream_events,
format_changed, impl->format);
if (count == 0)
pw_stream_finish_format(stream, 0, NULL, 0);
if (impl->format)
stream_set_state(stream, PW_STREAM_STATE_READY, NULL);