ALSA: pcm - Tell user that stream to be rewound is suspended
[pandora-kernel.git] / sound / core / pcm_native.c
index 84da3ba..d89c816 100644 (file)
@@ -320,7 +320,7 @@ int snd_pcm_hw_refine(struct snd_pcm_substream *substream,
                     snd_mask_max(&params->masks[SNDRV_PCM_HW_PARAM_CHANNELS])) {
                        changed = substream->ops->ioctl(substream,
                                        SNDRV_PCM_IOCTL1_FIFO_SIZE, params);
-                       if (params < 0)
+                       if (changed < 0)
                                return changed;
                }
        }
@@ -2208,6 +2208,9 @@ static snd_pcm_sframes_t snd_pcm_playback_rewind(struct snd_pcm_substream *subst
        case SNDRV_PCM_STATE_XRUN:
                ret = -EPIPE;
                goto __end;
+       case SNDRV_PCM_STATE_SUSPENDED:
+               ret = -ESTRPIPE;
+               goto __end;
        default:
                ret = -EBADFD;
                goto __end;
@@ -2253,6 +2256,9 @@ static snd_pcm_sframes_t snd_pcm_capture_rewind(struct snd_pcm_substream *substr
        case SNDRV_PCM_STATE_XRUN:
                ret = -EPIPE;
                goto __end;
+       case SNDRV_PCM_STATE_SUSPENDED:
+               ret = -ESTRPIPE;
+               goto __end;
        default:
                ret = -EBADFD;
                goto __end;
@@ -2299,6 +2305,9 @@ static snd_pcm_sframes_t snd_pcm_playback_forward(struct snd_pcm_substream *subs
        case SNDRV_PCM_STATE_XRUN:
                ret = -EPIPE;
                goto __end;
+       case SNDRV_PCM_STATE_SUSPENDED:
+               ret = -ESTRPIPE;
+               goto __end;
        default:
                ret = -EBADFD;
                goto __end;
@@ -2345,6 +2354,9 @@ static snd_pcm_sframes_t snd_pcm_capture_forward(struct snd_pcm_substream *subst
        case SNDRV_PCM_STATE_XRUN:
                ret = -EPIPE;
                goto __end;
+       case SNDRV_PCM_STATE_SUSPENDED:
+               ret = -ESTRPIPE;
+               goto __end;
        default:
                ret = -EBADFD;
                goto __end;