Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 56149
b: refs/heads/master
c: a971c3d
h: refs/heads/master
i:
  56147: 95e603d
v: v3
  • Loading branch information
Karsten Wiese authored and Jaroslav Kysela committed May 11, 2007
1 parent 31d684b commit f00382a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c052f046240b094b2ec12e0004e47756302e2b55
refs/heads/master: a971c3d42524afc5619fa271d59d29be3c1661e3
15 changes: 8 additions & 7 deletions trunk/sound/usb/caiaq/caiaq-audio.c
Original file line number Diff line number Diff line change
Expand Up @@ -388,8 +388,8 @@ static void read_in_urb_mode2(struct snd_usb_caiaqdev *dev,
struct snd_pcm_runtime *rt = sub->runtime;
char *audio_buf = rt->dma_area;
int sz = frames_to_bytes(rt, rt->buffer_size);
audio_buf[dev->audio_in_buf_pos[stream]++]
= usb_buf[i];
audio_buf[dev->audio_in_buf_pos[stream]++] =
usb_buf[i];
dev->period_in_count[stream]++;
if (dev->audio_in_buf_pos[stream] == sz)
dev->audio_in_buf_pos[stream] = 0;
Expand Down Expand Up @@ -436,27 +436,28 @@ static void fill_out_urb(struct snd_usb_caiaqdev *dev,
spin_lock(&dev->spinlock);

for (i = 0; i < iso->length;) {
for (stream = 0; stream < dev->n_streams; stream++) {
for (stream = 0; stream < dev->n_streams; stream++, i++) {
sub = dev->sub_playback[stream];
if (sub) {
struct snd_pcm_runtime *rt = sub->runtime;
char *audio_buf = rt->dma_area;
int sz = frames_to_bytes(rt, rt->buffer_size);
usb_buf[i++]
= audio_buf[dev->audio_out_buf_pos[stream]++];
usb_buf[i] =
audio_buf[dev->audio_out_buf_pos[stream]];
dev->period_out_count[stream]++;
dev->audio_out_buf_pos[stream]++;
if (dev->audio_out_buf_pos[stream] == sz)
dev->audio_out_buf_pos[stream] = 0;
} else
usb_buf[i++] = 0;
usb_buf[i] = 0;
}

/* fill in the check bytes */
if (dev->spec.data_alignment == 2 &&
i % (dev->n_streams * BYTES_PER_SAMPLE_USB) ==
(dev->n_streams * CHANNELS_PER_STREAM))
for (stream = 0; stream < dev->n_streams; stream++, i++)
usb_buf[i] = MAKE_CHECKBYTE(dev, stream, i);
}
}

spin_unlock(&dev->spinlock);
Expand Down

0 comments on commit f00382a

Please sign in to comment.