@@ -589,7 +589,8 @@ snd_compr_set_params(struct snd_compr_stream *stream, unsigned long arg)
struct snd_compr_params *params;
int retval;
- if (stream->runtime->state == SNDRV_PCM_STATE_OPEN) {
+ if (stream->runtime->state == SNDRV_PCM_STATE_OPEN ||
+ stream->runtime->state == SNDRV_PCM_STATE_RUNNING) {
/*
* we should allow parameter change only when stream has been
* opened not in other cases
@@ -612,10 +613,13 @@ snd_compr_set_params(struct snd_compr_stream *stream, unsigned long arg)
if (retval)
goto out;
- stream->metadata_set = false;
- stream->next_track = false;
+ if (stream->runtime->state == SNDRV_PCM_STATE_OPEN) {
+ stream->metadata_set = false;
+ stream->next_track = false;
+
+ stream->runtime->state = SNDRV_PCM_STATE_SETUP;
+ }
- stream->runtime->state = SNDRV_PCM_STATE_SETUP;
} else {
return -EPERM;
}