All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Sutar, Mounesh" <Mounesh_Sutar@mentor.com>
To: Takashi Iwai <tiwai@suse.de>,
	"sutar.mounesh@gmail.com" <sutar.mounesh@gmail.com>
Cc: "alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
	Andreas Pape <apape@de.adit-jv.com>
Subject: Re: [PATCH 6/6] pcm:plug: save converter config
Date: Mon, 27 Feb 2017 07:31:17 +0000	[thread overview]
Message-ID: <d42899e842814fd5b769b90f6418466c@SVR-IES-MBX-04.mgc.mentorg.com> (raw)
In-Reply-To: <s5ho9y0soe9.wl-tiwai@suse.de>

Hi Takashi,

Yes, it is redundant to delete plug->rate_converter.
The patch has been fixed and submitted.

Regards,
Mounesh


-----Original Message-----
From: Takashi Iwai [mailto:tiwai@suse.de] 
Sent: 17 February 2017 23:15
To: sutar.mounesh@gmail.com
Cc: alsa-devel@alsa-project.org; Sutar, Mounesh <Mounesh_Sutar@mentor.com>; Andreas Pape <apape@de.adit-jv.com>
Subject: Re: [PATCH 6/6] pcm:plug: save converter config

On Fri, 17 Feb 2017 08:18:02 +0100,
sutar.mounesh@gmail.com wrote:
> 
> From: Andreas Pape <apape@de.adit-jv.com>
> 
> Passed config is freed after call to open, thus it is invalid when 
> trying to extract the converter name. So config entry is saved for 
> later usage.
> 
> Signed-off-by: Andreas Pape <apape@de.adit-jv.com>
> Signed-off-by: Mounesh Sutar <sutar.mounesh@gmail.com>
> 
> diff --git a/src/pcm/pcm_plug.c b/src/pcm/pcm_plug.c index 
> 266707b..6d0c03d 100644
> --- a/src/pcm/pcm_plug.c
> +++ b/src/pcm/pcm_plug.c
> @@ -64,6 +64,8 @@ static int snd_pcm_plug_close(snd_pcm_t *pcm)
>  	snd_pcm_plug_t *plug = pcm->private_data;
>  	int err, result = 0;
>  	free(plug->ttable);
> +	if (plug->rate_converter)
> +		snd_config_delete((snd_config_t*)plug->rate_converter);
>  	assert(plug->gen.slave == plug->req_slave);
>  	if (plug->gen.close_slave) {
>  		snd_pcm_unlink_hw_ptr(pcm, plug->req_slave); @@ -1108,7 +1110,15 @@ 
> int snd_pcm_plug_open(snd_pcm_t **pcmp,
>  	plug->sformat = sformat;
>  	plug->schannels = schannels;
>  	plug->srate = srate;
> -	plug->rate_converter = rate_converter;
> +	if (rate_converter) {
> +		if ((err = snd_config_copy((snd_config_t**)&plug->rate_converter,
> +					   (snd_config_t *)rate_converter)) < 0)
> +			free(plug);
> +			return err;
> +	}
> +	else
> +		snd_config_delete((snd_config_t*)plug->rate_converter);

Why do we need to delete plug->rate_converter here...?
It's nowhere assigned after the patch?


thanks,

Takashi

      reply	other threads:[~2017-02-27  7:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-17  7:18 [PATCH 6/6] pcm:plug: save converter config sutar.mounesh
2017-02-17 17:44 ` Takashi Iwai
2017-02-27  7:31   ` Sutar, Mounesh [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d42899e842814fd5b769b90f6418466c@SVR-IES-MBX-04.mgc.mentorg.com \
    --to=mounesh_sutar@mentor.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=apape@de.adit-jv.com \
    --cc=sutar.mounesh@gmail.com \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.