OSDN Git Service

ALSA: pcm: Fix negative appl_ptr handling in pcm-indirect helpers
authorTakashi Iwai <tiwai@suse.de>
Fri, 19 May 2017 16:31:03 +0000 (18:31 +0200)
committerTakashi Iwai <tiwai@suse.de>
Thu, 25 May 2017 21:34:45 +0000 (23:34 +0200)
commit9629581258cb520a413a4240fc4254a45e0a81df
tree5d6e56291c1204c7ae743f34da3c03adde17b3a9
parent6dbaf8b913f2976ee776beb7c8bb0c52c7066ced
ALSA: pcm: Fix negative appl_ptr handling in pcm-indirect helpers

The indirect-PCM helper codes have an implicit assumption that the
appl_ptr always increases.  But the PCM core may deal with the
decrement of appl_ptr via rewind ioctls, and it may screw up the
buffer pointer management.

This patch adds the negative appl_ptr diff in transfer functions and
let returning an error instead of always accepting the appl_ptr
updates.  The callers are usually PCM ack callbacks, and they pass the
error to the upper layer accordingly.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
include/sound/pcm-indirect.h