alsa-utils/aplay
Daniel Baluta 1c9adf46b8 aplay: Fix playback for small raw files
This fixes a bug when trying to play files with size
smaller than maximum supported header size.

Lets have a look at the following example:

$ aplay -s 2 sample.raw

-> playback_go(fd = 10, loaded = 26, count = 2, name="sample.raw")
--> l = loaded = 26
--> c = count - written = 2
--> c -= l = 2 - 26 = -24
---> r = safe_read(fd, audiobuf + 26, -24)
---> r = -1, EXIT_FAILURE

In this case we have already 'loaded' from the input file more
bytes that we need to send to pcm device. So, we need to adjust
the number of bytes loaded and avoid reading a negative number
of bytes.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-08-09 10:39:36 +02:00
..
aplay.1 Several formatting fixes for manpages. 2013-05-16 10:38:13 +02:00
aplay.c aplay: Fix playback for small raw files 2017-08-09 10:39:36 +02:00
formats.h aplay: Add the support for big-endian WAV format (RIFX) 2012-12-13 10:53:19 +01:00
Makefile.am Makefiles - use AM_CPPFLAGS instead INCLUDES 2014-05-07 10:55:59 +02:00