From: Richard Fitzgerald Date: Thu, 2 May 2013 13:58:53 +0000 (+0100) Subject: compress: fix hpointer error when no sample rate X-Git-Tag: v0.2.0~7 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=aad6a2a407624ae8c50a8eed105ba436f0414a38;p=tinycompress.git compress: fix hpointer error when no sample rate 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 Signed-off-by: Vinod Koul --- diff --git a/compress.c b/compress.c index ee792c3..8753758 100644 --- a/compress.c +++ b/compress.c @@ -320,7 +320,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;