]> git.alsa-project.org Git - tinycompress.git/commitdiff
compress: fix hpointer error when no sample rate
authorRichard Fitzgerald <rf@opensource.wolfsonmicro.com>
Thu, 2 May 2013 13:58:53 +0000 (14:58 +0100)
committerVinod Koul <vinod.koul@intel.com>
Thu, 23 May 2013 02:26:31 +0000 (07:56 +0530)
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@opensource.wolfsonmicro.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
compress.c

index ee792c3fa3692031f1053672f43fe9666b1a1a5a..8753758302abe1f4ceb4d04b1ac7d8cf02dd5452 100644 (file)
@@ -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;