Re: [PATCH - PCM rate 1/1] pcm: rate: Use signed variable for return of snd_pcm_avail_update

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

 



On Wed, 04 Jul 2018 13:28:56 +0200,
<twischer@xxxxxxxxxxxxxx> wrote:
> 
> From: Timo Wischer <twischer@xxxxxxxxxxxxxx>
> 
> Without this changes a negative error code returned by
> snd_pcm_avail_update() will be not handled correctly
> 
> Signed-off-by: Timo Wischer <twischer@xxxxxxxxxxxxxx>

This is not about use signed value, but it *adds* the missing error
check from snd_pcm_avail_update().  So, please adjust the subject and
the changelog what you're actually fixing instead.


thanks,

Takashi

> diff --git a/src/pcm/pcm_rate.c b/src/pcm/pcm_rate.c
> index 4e0c7ca..031a43d 100644
> --- a/src/pcm/pcm_rate.c
> +++ b/src/pcm/pcm_rate.c
> @@ -970,9 +970,12 @@ static snd_pcm_sframes_t snd_pcm_rate_avail_update(snd_pcm_t *pcm)
>  {
>  	snd_pcm_rate_t *rate = pcm->private_data;
>  	snd_pcm_t *slave = rate->gen.slave;
> -	snd_pcm_uframes_t slave_size;
> +	snd_pcm_sframes_t slave_size;
>  
>  	slave_size = snd_pcm_avail_update(slave);
> +	if (slave_size < 0)
> +		return slave_size;
> +
>  	if (pcm->stream == SND_PCM_STREAM_CAPTURE)
>  		goto _capture;
>  	snd_pcm_rate_sync_hwptr(pcm);
> -- 
> 2.7.4
> 
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux