summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTanu Kaskinen <tanuk@iki.fi>2012-09-27 16:41:59 +0300
committerTanu Kaskinen <tanuk@iki.fi>2012-10-30 16:32:34 +0200
commit0a8634f03e64a84f594bc8533235998e969eda66 (patch)
treea1034c87c0b19d358be938bd9c53b36a60fd3eb5
parent0da87df4ec0e568a54f4560814e31dfdec4c5b50 (diff)
match: Use the SINK_INPUT_FIXATE hook instead of NEW.
The callback relies on the sample spec being finalized, which is not true with the NEW hook. In case you're wondering about the "hook EARLY - 1, to match before stream-restore" comment that was not changed even though the code that the comment concerned was changed: the comment was apparently written at a time when module-stream-restore used the NEW hook too, and later stream-restore has been changed to use the FIXATE hook. So, the comment was wrong/nonsensical before this patch. Since these two modules now use the same hook again, the comment makes sense again. BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=55135
-rw-r--r--src/modules/module-match.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/modules/module-match.c b/src/modules/module-match.c
index c94ef790..e42f44ef 100644
--- a/src/modules/module-match.c
+++ b/src/modules/module-match.c
@@ -80,7 +80,7 @@ struct rule {
struct userdata {
struct rule *rules;
char *property_key;
- pa_hook_slot *sink_input_new_hook_slot;
+ pa_hook_slot *sink_input_fixate_hook_slot;
};
static int load_rules(struct userdata *u, const char *filename) {
@@ -213,7 +213,7 @@ finish:
return ret;
}
-static pa_hook_result_t sink_input_new_hook_callback(pa_core *c, pa_sink_input_new_data *si, struct userdata *u) {
+static pa_hook_result_t sink_input_fixate_hook_callback(pa_core *c, pa_sink_input_new_data *si, struct userdata *u) {
struct rule *r;
const char *n;
@@ -264,7 +264,7 @@ int pa__init(pa_module*m) {
goto fail;
/* hook EARLY - 1, to match before stream-restore */
- u->sink_input_new_hook_slot = pa_hook_connect(&m->core->hooks[PA_CORE_HOOK_SINK_INPUT_NEW], PA_HOOK_EARLY - 1, (pa_hook_cb_t) sink_input_new_hook_callback, u);
+ u->sink_input_fixate_hook_slot = pa_hook_connect(&m->core->hooks[PA_CORE_HOOK_SINK_INPUT_FIXATE], PA_HOOK_EARLY - 1, (pa_hook_cb_t) sink_input_fixate_hook_callback, u);
pa_modargs_free(ma);
return 0;
@@ -286,8 +286,8 @@ void pa__done(pa_module*m) {
if (!(u = m->userdata))
return;
- if (u->sink_input_new_hook_slot)
- pa_hook_slot_free(u->sink_input_new_hook_slot);
+ if (u->sink_input_fixate_hook_slot)
+ pa_hook_slot_free(u->sink_input_fixate_hook_slot);
if (u->property_key)
pa_xfree(u->property_key);