[PATCH] card-restore: Watch for profiles added after card creation.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2013-07-25 at 16:39 +0200, poljar (Damir Jeli?) wrote:
> This patch adds the ability to restore profiles if they are added after
> card creation.
> 
> Adding profiles after card creation mainly happens for bluetooth cards.
> 
> Buglink: https://bugs.freedesktop.org/show_bug.cgi?id=65349
> ---
>  src/modules/module-card-restore.c | 29 +++++++++++++++++++++++++----
>  1 file changed, 25 insertions(+), 4 deletions(-)

Applied, thanks! I fixed a small issue pointed out below.

> +static pa_hook_result_t card_profile_added_callback(pa_core *c, pa_card_profile *profile, struct userdata *u) {
> +    struct entry *entry;
> +
> +    pa_assert(profile);
> +
> +    if (!(entry = entry_read(u, profile->card->name)))
> +        return PA_HOOK_OK;
> +
> +    if (pa_safe_streq(entry->profile, profile->name)) {
> +        pa_card_set_profile(profile->card, profile->name, true);
> +        pa_log_info("Restored profile '%s' for card %s.", profile->name, profile->card->name);

pa_card_set_profile() can fail, in which case the log message shouldn't
be printed.

-- 
Tanu



[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux