mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-01 06:33:07 +00:00
ALSA: firewire-lib: fix wrong handling payload_length as payload_quadlet
commitada79fa5a0
upstream. In IEC 61883-1/6 engine of ALSA firewire stack, a packet handler has a second argument for 'the number of bytes in payload of isochronous packet'. However, an incoming packet handler without CIP header uses the value as 'the number of quadlets in the payload'. This brings userspace applications to receive the number of PCM frames as four times against real time. This commit fixes the bug. Cc: <stable@vger.kernel.org> # v4.12+ Fixes:3b196c394d
('ALSA: firewire-lib: add no-header packet processing') Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
47cafb1329
commit
deec542ba5
1 changed files with 3 additions and 1 deletions
|
@ -629,15 +629,17 @@ static int handle_in_packet(struct amdtp_stream *s,
|
||||||
}
|
}
|
||||||
|
|
||||||
static int handle_in_packet_without_header(struct amdtp_stream *s,
|
static int handle_in_packet_without_header(struct amdtp_stream *s,
|
||||||
unsigned int payload_quadlets, unsigned int cycle,
|
unsigned int payload_length, unsigned int cycle,
|
||||||
unsigned int index)
|
unsigned int index)
|
||||||
{
|
{
|
||||||
__be32 *buffer;
|
__be32 *buffer;
|
||||||
|
unsigned int payload_quadlets;
|
||||||
unsigned int data_blocks;
|
unsigned int data_blocks;
|
||||||
struct snd_pcm_substream *pcm;
|
struct snd_pcm_substream *pcm;
|
||||||
unsigned int pcm_frames;
|
unsigned int pcm_frames;
|
||||||
|
|
||||||
buffer = s->buffer.packets[s->packet_index].buffer;
|
buffer = s->buffer.packets[s->packet_index].buffer;
|
||||||
|
payload_quadlets = payload_length / 4;
|
||||||
data_blocks = payload_quadlets / s->data_block_quadlets;
|
data_blocks = payload_quadlets / s->data_block_quadlets;
|
||||||
|
|
||||||
trace_in_packet_without_header(s, cycle, payload_quadlets, data_blocks,
|
trace_in_packet_without_header(s, cycle, payload_quadlets, data_blocks,
|
||||||
|
|
Loading…
Reference in a new issue