[ALSA] rawmidi: adjust runtime->avail when changing output buffer size
authorClemens Ladisch <clemens@ladisch.de>
Mon, 21 Nov 2005 06:31:31 +0000 (07:31 +0100)
committerJaroslav Kysela <perex@suse.cz>
Tue, 3 Jan 2006 11:29:25 +0000 (12:29 +0100)
Modules: RawMidi Midlevel

When the output buffer size is changed, runtime->avail must be
adjusted to the new size; otherwise, draining of a bigger buffer would
appear to fail because avail does not reach buffer_size.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
sound/core/rawmidi.c

index e6ee0d813783ab9574630deae48ea354baf39c69..587ea1eb3197de84edc31b55f2603eb860dfbb16 100644 (file)
@@ -635,6 +635,7 @@ int snd_rawmidi_output_params(struct snd_rawmidi_substream *substream,
                kfree(runtime->buffer);
                runtime->buffer = newbuf;
                runtime->buffer_size = params->buffer_size;
+               runtime->avail = runtime->buffer_size;
        }
        runtime->avail_min = params->avail_min;
        substream->active_sensing = !params->no_active_sensing;