diff options
Diffstat (limited to 'meta/recipes-multimedia/pulseaudio/pulseaudio/0002-alsa-bluetooth-fail-if-user-requested-profile-doesn-.patch')
-rw-r--r-- | meta/recipes-multimedia/pulseaudio/pulseaudio/0002-alsa-bluetooth-fail-if-user-requested-profile-doesn-.patch | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/meta/recipes-multimedia/pulseaudio/pulseaudio/0002-alsa-bluetooth-fail-if-user-requested-profile-doesn-.patch b/meta/recipes-multimedia/pulseaudio/pulseaudio/0002-alsa-bluetooth-fail-if-user-requested-profile-doesn-.patch new file mode 100644 index 0000000000..c3f217bc64 --- /dev/null +++ b/meta/recipes-multimedia/pulseaudio/pulseaudio/0002-alsa-bluetooth-fail-if-user-requested-profile-doesn-.patch | |||
@@ -0,0 +1,60 @@ | |||
1 | From 339eb179baa7810113f6456accc05b3a32c1cdba Mon Sep 17 00:00:00 2001 | ||
2 | From: Tanu Kaskinen <tanuk@iki.fi> | ||
3 | Date: Fri, 23 Oct 2015 12:36:34 +0300 | ||
4 | Subject: [PATCH 2/4] alsa, bluetooth: fail if user-requested profile doesn't | ||
5 | exist | ||
6 | |||
7 | If we can't fulfill the user request fully, I think we shouldn't | ||
8 | fulfill it at all, to make it clear that the requested operation | ||
9 | didn't succeed. | ||
10 | |||
11 | http://bugzilla.yoctoproject.org/show_bug.cgi?id=8448 | ||
12 | |||
13 | Upstream-Status: Submitted [http://lists.freedesktop.org/archives/pulseaudio-discuss/2015-October/024614.html] | ||
14 | Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com> | ||
15 | --- | ||
16 | src/modules/alsa/module-alsa-card.c | 10 ++++++++-- | ||
17 | src/modules/bluetooth/module-bluez4-device.c | 6 ++++-- | ||
18 | 2 files changed, 12 insertions(+), 4 deletions(-) | ||
19 | |||
20 | diff --git a/src/modules/alsa/module-alsa-card.c b/src/modules/alsa/module-alsa-card.c | ||
21 | index a7fec04..32f517e 100644 | ||
22 | --- a/src/modules/alsa/module-alsa-card.c | ||
23 | +++ b/src/modules/alsa/module-alsa-card.c | ||
24 | @@ -754,8 +754,14 @@ int pa__init(pa_module *m) { | ||
25 | goto fail; | ||
26 | } | ||
27 | |||
28 | - if ((profile = pa_modargs_get_value(u->modargs, "profile", NULL))) | ||
29 | - pa_card_new_data_set_profile(&data, profile); | ||
30 | + if ((profile = pa_modargs_get_value(u->modargs, "profile", NULL))) { | ||
31 | + if (pa_hashmap_get(data.profiles, profile)) | ||
32 | + pa_card_new_data_set_profile(&data, profile); | ||
33 | + else { | ||
34 | + pa_log("No such profile: %s", profile); | ||
35 | + goto fail; | ||
36 | + } | ||
37 | + } | ||
38 | |||
39 | u->card = pa_card_new(m->core, &data); | ||
40 | pa_card_new_data_done(&data); | ||
41 | diff --git a/src/modules/bluetooth/module-bluez4-device.c b/src/modules/bluetooth/module-bluez4-device.c | ||
42 | index b40c6a0..94e6988 100644 | ||
43 | --- a/src/modules/bluetooth/module-bluez4-device.c | ||
44 | +++ b/src/modules/bluetooth/module-bluez4-device.c | ||
45 | @@ -2310,8 +2310,10 @@ static int add_card(struct userdata *u) { | ||
46 | if ((default_profile = pa_modargs_get_value(u->modargs, "profile", NULL))) { | ||
47 | if (pa_hashmap_get(data.profiles, default_profile)) | ||
48 | pa_card_new_data_set_profile(&data, default_profile); | ||
49 | - else | ||
50 | - pa_log_warn("Profile '%s' not valid or not supported by device.", default_profile); | ||
51 | + else { | ||
52 | + pa_log("Profile '%s' not valid or not supported by device.", default_profile); | ||
53 | + return -1; | ||
54 | + } | ||
55 | } | ||
56 | |||
57 | u->card = pa_card_new(u->core, &data); | ||
58 | -- | ||
59 | 2.1.4 | ||
60 | |||