[pulseaudio-discuss] [PATCH v2 1/6] alsa, bluetooth: fail if user-requested profile doesn't exist
Tanu Kaskinen
tanuk at iki.fi
Sun Jun 12 20:09:15 UTC 2016
On Sun, 2016-06-12 at 18:14 +0500, Alexander E. Patrakov wrote:
> 10.06.2016 22:55, Tanu Kaskinen wrote:
> > If we can't fulfill the user request fully, I think we shouldn't
> > fulfill it at all, to make it clear that the requested operation
> > didn't succeed.
> > ---
> > src/modules/alsa/module-alsa-card.c | 10 ++++++++--
> > src/modules/bluetooth/module-bluez4-device.c | 7 +++++--
> > 2 files changed, 13 insertions(+), 4 deletions(-)
> >
> > diff --git a/src/modules/alsa/module-alsa-card.c b/src/modules/alsa/module-alsa-card.c
> > index e5cc4ae..1ab2ea2 100644
> > --- a/src/modules/alsa/module-alsa-card.c
> > +++ b/src/modules/alsa/module-alsa-card.c
> > @@ -799,8 +799,14 @@ int pa__init(pa_module *m) {
> > goto fail;
> > }
> >
> > - if ((profile = pa_modargs_get_value(u->modargs, "profile", NULL)))
> > - pa_card_new_data_set_profile(&data, profile);
> > + if ((profile = pa_modargs_get_value(u->modargs, "profile", NULL))) {
> > + if (pa_hashmap_get(data.profiles, profile))
> > + pa_card_new_data_set_profile(&data, profile);
> > + else {
> > + pa_log("No such profile: %s", profile);
> > + goto fail;
>
> Missed call to pa_card_new_data_done(&data); ?
Yes. Will fix.
(In the first version the call was missing from both alsa and bluez4,
but for some reason I fixed it only in the bluez4 code.)
--
Tanu
More information about the pulseaudio-discuss
mailing list