Skip to content

Commit

Permalink
ALSA: snd-usb: fix next_packet_size calls for pause case
Browse files Browse the repository at this point in the history
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 <[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]>
  • Loading branch information
zonque authored and torvalds committed Sep 27, 2012
1 parent 9a7c590 commit 8dce30c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion sound/usb/endpoint.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8dce30c

Please sign in to comment.