Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ALSA: compress: Don't allow paritial drain operations on capture streams

Partial drain and next track are intended for gapless playback and
don't really have an obvious interpretation for a capture stream, so
makes sense to not allow those operations on capture streams.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Acked-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

authored by

Charles Keepax and committed by
Takashi Iwai
a70ab8a8 26c3f154

+8
+8
sound/core/compress_offload.c
··· 834 834 if (stream->runtime->state != SNDRV_PCM_STATE_RUNNING) 835 835 return -EPERM; 836 836 837 + /* next track doesn't have any meaning for capture streams */ 838 + if (stream->direction == SND_COMPRESS_CAPTURE) 839 + return -EPERM; 840 + 837 841 /* you can signal next track if this is intended to be a gapless stream 838 842 * and current track metadata is set 839 843 */ ··· 864 860 default: 865 861 break; 866 862 } 863 + 864 + /* partial drain doesn't have any meaning for capture streams */ 865 + if (stream->direction == SND_COMPRESS_CAPTURE) 866 + return -EPERM; 867 867 868 868 /* stream can be drained only when next track has been signalled */ 869 869 if (stream->next_track == false)