Permalink
Browse files

ALSA: snd-usb: fix next_packet_size calls for pause case

Also fix the calls to next_packet_size() for the pause case. This was
missed in 245baf9 ("ALSA: snd-usb: fix calls to next_packet_size").

Signed-off-by: Daniel Mack <zonque@gmail.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Reported-and-tested-by: Christian Tefzer <ctrefzer@gmx.de>
Cc: stable@kernel.org
[ Taking directly because Takashi is on vacation  - Linus ]
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information...
1 parent 9a7c590 commit 8dce30c89113e314d29d3b8f362aadff8087fccb @zonque zonque committed with torvalds Sep 27, 2012
Showing with 7 additions and 1 deletion.
  1. +7 −1 sound/usb/endpoint.c
View
@@ -197,7 +197,13 @@ static void prepare_outbound_urb(struct snd_usb_endpoint *ep,
/* no data provider, so send silence */
unsigned int offs = 0;
for (i = 0; i < ctx->packets; ++i) {
- int counts = ctx->packet_size[i];
+ int counts;
+
+ if (ctx->packet_size[i])
+ counts = ctx->packet_size[i];
+ else
+ counts = snd_usb_endpoint_next_packet_size(ep);
+
urb->iso_frame_desc[i].offset = offs * ep->stride;
urb->iso_frame_desc[i].length = counts * ep->stride;
offs += counts;

0 comments on commit 8dce30c

Please sign in to comment.