[alsa-devel] [TINYCOMPRESS][PATCH 1/1] compress: fix hpointer error when no sample rate

Vinod Koul vinod.koul at intel.com
Thu May 23 04:28:37 CEST 2013


On Thu, May 02, 2013 at 02:58:53PM +0100, Richard Fitzgerald wrote:
> Fixes the oops() in compress_get_hpointer() to return
> -ENODATA instead of errno if the sample rate is zero.
> The value in errno here is not related to the reason
> we are returning an error.
> 
> Signed-off-by: Richard Fitzgerald <rf at opensource.wolfsonmicro.com>
Applied thanks

--
~Vinod
> ---
>  compress.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/compress.c b/compress.c
> index e80e598..abd0799 100644
> --- a/compress.c
> +++ b/compress.c
> @@ -315,7 +315,7 @@ int compress_get_hpointer(struct compress *compress,
>  	if (ioctl(compress->fd, SNDRV_COMPRESS_AVAIL, &kavail))
>  		return oops(compress, errno, "cannot get avail");
>  	if (0 == kavail.tstamp.sampling_rate)
> -		return oops(compress, errno, "invalid paramter");
> +		return oops(compress, -ENODATA, "sample rate unknown");
>  	*avail = (unsigned int)kavail.avail;
>  	time = kavail.tstamp.pcm_io_frames / kavail.tstamp.sampling_rate;
>  	tstamp->tv_sec = time;
> -- 
> 1.7.2.5
> 
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel at alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel


More information about the Alsa-devel mailing list