[pulseaudio-commits] [SCM] PulseAudio Sound Server branch, master, updated. v0.9.15-151-ge5dd9df
Lennart Poettering
gitmailer-noreply at 0pointer.de
Fri Jun 5 10:24:58 PDT 2009
This is an automated email from the git hooks/post-receive script. It was
generated because of a push to the "PulseAudio Sound Server" repository.
The master branch has been updated
from 561c0af8518dd8a2bac07284d306b0970c304f9f (commit)
- Log -----------------------------------------------------------------
e5dd9df rtp: remove gcc warning
f398407 augment: try to deduce the media role from the menu category
-----------------------------------------------------------------------
Summary of changes:
src/modules/module-augment-properties.c | 73 ++++++++++++++++++++++++++++---
src/modules/rtp/module-rtp-send.c | 4 +-
2 files changed, 69 insertions(+), 8 deletions(-)
-----------------------------------------------------------------------
commit f398407544b7eef1cad4a1e79ccd3c29ea1beb81
Author: Lennart Poettering <lennart at poettering.net>
Date: Fri Jun 5 19:24:40 2009 +0200
augment: try to deduce the media role from the menu category
diff --git a/src/modules/module-augment-properties.c b/src/modules/module-augment-properties.c
index c3e5997..15aa3a1 100644
--- a/src/modules/module-augment-properties.c
+++ b/src/modules/module-augment-properties.c
@@ -58,6 +58,7 @@ struct rule {
char *process_name;
char *application_name;
char *icon_name;
+ char *role;
pa_proplist *proplist;
};
@@ -72,12 +73,21 @@ static void rule_free(struct rule *r) {
pa_xfree(r->process_name);
pa_xfree(r->application_name);
pa_xfree(r->icon_name);
+ pa_xfree(r->role);
if (r->proplist)
pa_proplist_free(r->proplist);
pa_xfree(r);
}
-static int parse_properties(const char *filename, unsigned line, const char *section, const char *lvalue, const char *rvalue, void *data, void *userdata) {
+static int parse_properties(
+ const char *filename,
+ unsigned line,
+ const char *section,
+ const char *lvalue,
+ const char *rvalue,
+ void *data,
+ void *userdata) {
+
struct rule *r = userdata;
pa_proplist *n;
@@ -93,11 +103,56 @@ static int parse_properties(const char *filename, unsigned line, const char *sec
return 0;
}
-static int check_type(const char *filename, unsigned line, const char *section, const char *lvalue, const char *rvalue, void *data, void *userdata) {
+static int parse_categories(
+ const char *filename,
+ unsigned line,
+ const char *section,
+ const char *lvalue,
+ const char *rvalue,
+ void *data,
+ void *userdata) {
+
+ struct rule *r = userdata;
+ const char *state = NULL;
+ char *c;
+
+ while ((c = pa_split(rvalue, ";", &state))) {
+
+ if (pa_streq(c, "Game")) {
+ pa_xfree(r->role);
+ r->role = pa_xstrdup("game");
+ } else if (pa_streq(c, "Telephony")) {
+ pa_xfree(r->role);
+ r->role = pa_xstrdup("phone");
+ }
+
+ pa_xfree(c);
+ }
+
+ return 0;
+}
+
+static int check_type(
+ const char *filename,
+ unsigned line,
+ const char *section,
+ const char *lvalue,
+ const char *rvalue,
+ void *data,
+ void *userdata) {
+
return pa_streq(rvalue, "Application") ? 0 : -1;
}
-static int catch_all(const char *filename, unsigned line, const char *section, const char *lvalue, const char *rvalue, void *data, void *userdata) {
+static int catch_all(
+ const char *filename,
+ unsigned line,
+ const char *section,
+ const char *lvalue,
+ const char *rvalue,
+ void *data,
+ void *userdata) {
+
return 0;
}
@@ -109,6 +164,7 @@ static void update_rule(struct rule *r) {
{ "Icon", pa_config_parse_string, NULL, "Desktop Entry" },
{ "Type", check_type, NULL, "Desktop Entry" },
{ "X-PulseAudio-Properties", parse_properties, NULL, "Desktop Entry" },
+ { "Categories", parse_categories, NULL, "Desktop Entry" },
{ NULL, catch_all, NULL, NULL },
{ NULL, NULL, NULL, NULL },
};
@@ -131,7 +187,8 @@ static void update_rule(struct rule *r) {
r->mtime = st.st_mtime;
pa_xfree(r->application_name);
pa_xfree(r->icon_name);
- r->application_name = r->icon_name = NULL;
+ pa_xfree(r->role);
+ r->application_name = r->icon_name = r->role = NULL;
if (r->proplist)
pa_proplist_clear(r->proplist);
@@ -151,6 +208,9 @@ static void apply_rule(struct rule *r, pa_proplist *p) {
if (!r->good)
return;
+ if (r->proplist)
+ pa_proplist_update(p, PA_UPDATE_MERGE, r->proplist);
+
if (r->icon_name)
if (!pa_proplist_contains(p, PA_PROP_APPLICATION_ICON_NAME))
pa_proplist_sets(p, PA_PROP_APPLICATION_ICON_NAME, r->icon_name);
@@ -164,8 +224,9 @@ static void apply_rule(struct rule *r, pa_proplist *p) {
pa_proplist_sets(p, PA_PROP_APPLICATION_NAME, r->application_name);
}
- if (r->proplist)
- pa_proplist_update(p, PA_UPDATE_MERGE, r->proplist);
+ if (r->role)
+ if (!pa_proplist_contains(p, PA_PROP_MEDIA_ROLE))
+ pa_proplist_sets(p, PA_PROP_MEDIA_ROLE, r->role);
}
static void make_room(pa_hashmap *cache) {
commit e5dd9dfe682000f75d2770c21fd26d6cc56e3c4d
Author: Lennart Poettering <lennart at poettering.net>
Date: Fri Jun 5 19:25:15 2009 +0200
rtp: remove gcc warning
diff --git a/src/modules/rtp/module-rtp-send.c b/src/modules/rtp/module-rtp-send.c
index cdd2c57..39ee4d7 100644
--- a/src/modules/rtp/module-rtp-send.c
+++ b/src/modules/rtp/module-rtp-send.c
@@ -347,8 +347,8 @@ int pa__init(pa_module*m) {
o->push = source_output_push;
o->kill = source_output_kill;
- pa_log_info("Configured source latency of %lu ms.",
- pa_source_output_set_requested_latency(o, pa_bytes_to_usec(mtu, &o->sample_spec)) / PA_USEC_PER_MSEC);
+ pa_log_info("Configured source latency of %llu ms.",
+ (unsigned long long) pa_source_output_set_requested_latency(o, pa_bytes_to_usec(mtu, &o->sample_spec)) / PA_USEC_PER_MSEC);
m->userdata = o->userdata = u = pa_xnew(struct userdata, 1);
u->module = m;
--
hooks/post-receive
PulseAudio Sound Server
More information about the pulseaudio-commits
mailing list