"format=<sample format> "
"channels=<number of channels> "
"rate=<sample rate> "
- "channel_map=<channel map>"
+ "channel_map=<channel map> "
+ "cookie=<cookie file path>"
);
#define TUNNEL_THREAD_FAILED_MAINLOOP 1
bool connected;
+ char *cookie_file;
char *remote_server;
char *remote_sink_name;
};
"channels",
"rate",
"channel_map",
- /* "cookie", unimplemented */
+ "cookie",
/* "reconnect", reconnect if server comes back again - unimplemented */
NULL,
};
goto fail;
}
+ if (u->cookie_file && pa_context_load_cookie_from_file(u->context, u->cookie_file) != 0) {
+ pa_log_error("Can not load cookie file!");
+ goto fail;
+ }
+
pa_context_set_state_callback(u->context, context_state_cb, u);
if (pa_context_connect(u->context,
u->remote_server,
goto fail;
}
u->thread_mainloop_api = pa_mainloop_get_api(u->thread_mainloop);
-
+ u->cookie_file = pa_xstrdup(pa_modargs_get_value(ma, "cookie", NULL));
u->remote_sink_name = pa_xstrdup(pa_modargs_get_value(ma, "sink", NULL));
u->thread_mq = pa_xnew0(pa_thread_mq, 1);
if (u->thread_mainloop)
pa_mainloop_free(u->thread_mainloop);
+ if (u->cookie_file)
+ pa_xfree(u->cookie_file);
+
if (u->remote_sink_name)
pa_xfree(u->remote_sink_name);
"format=<sample format> "
"channels=<number of channels> "
"rate=<sample rate> "
- "channel_map=<channel map>"
+ "channel_map=<channel map> "
+ "cookie=<cookie file path>"
);
#define TUNNEL_THREAD_FAILED_MAINLOOP 1
bool connected;
bool new_data;
+ char *cookie_file;
char *remote_server;
char *remote_source_name;
};
"channels",
"rate",
"channel_map",
- /* "cookie", unimplemented */
+ "cookie",
/* "reconnect", reconnect if server comes back again - unimplemented */
NULL,
};
goto fail;
}
+ if (u->cookie_file && pa_context_load_cookie_from_file(u->context, u->cookie_file) != 0) {
+ pa_log_error("Can not load cookie file!");
+ goto fail;
+ }
+
pa_context_set_state_callback(u->context, context_state_cb, u);
if (pa_context_connect(u->context,
u->remote_server,
goto fail;
}
u->thread_mainloop_api = pa_mainloop_get_api(u->thread_mainloop);
+ u->cookie_file = pa_xstrdup(pa_modargs_get_value(ma, "cookie", NULL));
u->remote_source_name = pa_xstrdup(pa_modargs_get_value(ma, "source", NULL));
u->thread_mq = pa_xnew0(pa_thread_mq, 1);
if (u->thread_mainloop)
pa_mainloop_free(u->thread_mainloop);
+ if (u->cookie_file)
+ pa_xfree(u->cookie_file);
+
if (u->remote_source_name)
pa_xfree(u->remote_source_name);