]> git.karo-electronics.de Git - linux-beck.git/commitdiff
staging: line6: fix playback urb transfer buffer calculation
authorStefan Hajnoczi <stefanha@gmail.com>
Sat, 10 Dec 2011 01:12:28 +0000 (02:12 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Sat, 10 Dec 2011 03:26:09 +0000 (19:26 -0800)
The playback urb transfer buffer calculation does not factor in
LINE6_ISO_PACKETS.  Buffer memory is organized like this in the driver:

  Buffer 0                 Buffer 1                 ...
  [Packet 0, Packet 1, ...][Packet 0, Packet 1, ...][Packet 0, ...]

However, we're lucky that LINE6_ISO_PACKETS is currently defined as 1 so
this patch does not change any behavior.  It's still worth including
this fix in case the LINE6_ISO_PACKETS value is changed in the future.

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Markus Grabner <grabner@icg.tugraz.at>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/line6/playback.c

index ed1b9bd93ff8d7ef1bb594bdd5bf5ddaa6f728fd..b17c0a7708dddbae8e9a72387e982263f0d1b280 100644 (file)
@@ -192,7 +192,7 @@ static int submit_audio_out_urb(struct snd_line6_pcm *line6pcm)
        urb_frames = urb_size / bytes_per_frame;
        urb_out->transfer_buffer =
            line6pcm->buffer_out +
-           line6pcm->max_packet_size * line6pcm->index_out;
+           LINE6_ISO_PACKETS * line6pcm->max_packet_size * line6pcm->index_out;
        urb_out->transfer_buffer_length = urb_size;
        urb_out->context = line6pcm;