ALSA: isight: fix packet requeueing
authorClemens Ladisch <clemens@ladisch.de>
Wed, 11 May 2011 08:48:24 +0000 (10:48 +0200)
committerTakashi Iwai <tiwai@suse.de>
Wed, 11 May 2011 12:51:13 +0000 (14:51 +0200)
After handling a received packet, we want to resubmit the same packet,
so do not increase the packet index too early.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/firewire/isight.c

index 0230605..4e33491 100644 (file)
@@ -198,9 +198,6 @@ static void isight_packet(struct fw_iso_context *context, u32 cycle,
                }
        }
 
-       if (++index >= QUEUE_LENGTH)
-               index = 0;
-
        err = fw_iso_context_queue(isight->context, &audio_packet,
                                   &isight->buffer.iso_buffer,
                                   isight->buffer.packets[index].offset);
@@ -211,6 +208,8 @@ static void isight_packet(struct fw_iso_context *context, u32 cycle,
                return;
        }
 
+       if (++index >= QUEUE_LENGTH)
+               index = 0;
        isight->packet_index = index;
 }