Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 248144
b: refs/heads/master
c: e220fa3
h: refs/heads/master
v: v3
  • Loading branch information
Torsten Schenk authored and Takashi Iwai committed Apr 4, 2011
1 parent d787019 commit 313dbcb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 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: 78caf66cb568f2b0c63bf8f87cff2fe1583dd9d0
refs/heads/master: e220fa3bf503d63039fa8e0398a1c252d24663f9
13 changes: 5 additions & 8 deletions trunk/sound/usb/6fire/pcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ static int usb6fire_pcm_close(struct snd_pcm_substream *alsa_sub)
/* all substreams closed? if so, stop streaming */
if (!rt->playback.instance && !rt->capture.instance) {
usb6fire_pcm_stream_stop(rt);
rt->rate = -1;
rt->rate = ARRAY_SIZE(rates);
}
}
mutex_unlock(&rt->stream_mutex);
Expand All @@ -480,7 +480,6 @@ static int usb6fire_pcm_prepare(struct snd_pcm_substream *alsa_sub)
struct pcm_runtime *rt = snd_pcm_substream_chip(alsa_sub);
struct pcm_substream *sub = usb6fire_pcm_get_substream(alsa_sub);
struct snd_pcm_runtime *alsa_rt = alsa_sub->runtime;
int i;
int ret;

if (rt->panic)
Expand All @@ -493,12 +492,10 @@ static int usb6fire_pcm_prepare(struct snd_pcm_substream *alsa_sub)
sub->period_off = 0;

if (rt->stream_state == STREAM_DISABLED) {
for (i = 0; i < ARRAY_SIZE(rates); i++)
if (alsa_rt->rate == rates[i]) {
rt->rate = i;
for (rt->rate = 0; rt->rate < ARRAY_SIZE(rates); rt->rate++)
if (alsa_rt->rate == rates[rt->rate])
break;
}
if (i == ARRAY_SIZE(rates)) {
if (rt->rate == ARRAY_SIZE(rates)) {
mutex_unlock(&rt->stream_mutex);
snd_printk("invalid rate %d in prepare.\n",
alsa_rt->rate);
Expand Down Expand Up @@ -613,7 +610,7 @@ int __devinit usb6fire_pcm_init(struct sfire_chip *chip)

rt->chip = chip;
rt->stream_state = STREAM_DISABLED;
rt->rate = -1;
rt->rate = ARRAY_SIZE(rates);
init_waitqueue_head(&rt->stream_wait_queue);
mutex_init(&rt->stream_mutex);

Expand Down

0 comments on commit 313dbcb

Please sign in to comment.