diff options
author | Stefan Hajnoczi <stefanha@gmail.com> | 2011-12-10 01:12:29 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-12-10 03:26:09 (GMT) |
commit | 153e38761d27f29edf436f11da3dbfb4fb8edcc1 (patch) | |
tree | f05383b59f5ce13dfa45e177b14e3fef8f8f4b91 /drivers/staging/line6 | |
parent | 2f637ee42d4a60e1c3823beff3699354bd4400be (diff) | |
download | linux-153e38761d27f29edf436f11da3dbfb4fb8edcc1.tar.xz |
staging: line6: eliminate useless index_out variable
Playback urbs use the index_out counter to decide which part of the
playback buffer to use. Since the urb already has a unique index in
range [0, LINE6_ISO_BUFFERS) there is no need to keep a separate
counter.
Use the urb index instead. This also eliminates the possibility of two
urbs using the same playback buffer space if they ever complete
out-of-order for some reason.
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>
Diffstat (limited to 'drivers/staging/line6')
-rw-r--r-- | drivers/staging/line6/pcm.h | 5 | ||||
-rw-r--r-- | drivers/staging/line6/playback.c | 5 |
2 files changed, 1 insertions, 9 deletions
diff --git a/drivers/staging/line6/pcm.h b/drivers/staging/line6/pcm.h index 05f4ef3..55d8297 100644 --- a/drivers/staging/line6/pcm.h +++ b/drivers/staging/line6/pcm.h @@ -146,11 +146,6 @@ struct snd_line6_pcm { unsigned char *buffer_in; /** - Temporary buffer index for playback. - */ - int index_out; - - /** Previously captured frame (for software monitoring). */ unsigned char *prev_fbuf; diff --git a/drivers/staging/line6/playback.c b/drivers/staging/line6/playback.c index b17c0a7..9a51b92 100644 --- a/drivers/staging/line6/playback.c +++ b/drivers/staging/line6/playback.c @@ -192,13 +192,10 @@ 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 + - LINE6_ISO_PACKETS * line6pcm->max_packet_size * line6pcm->index_out; + index * LINE6_ISO_PACKETS * line6pcm->max_packet_size; urb_out->transfer_buffer_length = urb_size; urb_out->context = line6pcm; - if (++line6pcm->index_out == LINE6_ISO_BUFFERS) - line6pcm->index_out = 0; - if (test_bit(BIT_PCM_ALSA_PLAYBACK, &line6pcm->flags) && !test_bit(BIT_PAUSE_PLAYBACK, &line6pcm->flags)) { struct snd_pcm_runtime *runtime = |