projects/linux·commit 8dce30c8

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

8dce30c8 · Daniel Mack <[email protected]> · 2012-09-27 10:26:01 +02:00

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

Signed-off-by: Daniel Mack <[email protected]>
Reviewed-by: Takashi Iwai <[email protected]>
Reported-and-tested-by: Christian Tefzer <[email protected]>
Cc: [email protected]
[ Taking directly because Takashi is on vacation  - Linus ]
Signed-off-by: Linus Torvalds <[email protected]>
Commit
8dce30c89113e314d29d3b8f362aadff8087fccb
Parents
9a7c5909

Changes

1 files changed · +7 −1

FileStatusAddDelContent
sound/usb/endpoint.cmodified+7−1View file

sound/usb/endpoint.c

View file
diff --git a/sound/usb/endpoint.c b/sound/usb/endpoint.c
index d6e2bb4..060dccb 100644
--- a/sound/usb/endpoint.c
+++ b/sound/usb/endpoint.c
@@ -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;