From: Clemens Ladisch Date: Mon, 21 Nov 2005 06:31:31 +0000 (+0100) Subject: [ALSA] rawmidi: adjust runtime->avail when changing output buffer size X-Git-Tag: accepted/tizen/common/20141203.182822~40740^2~16^2~28^2~73 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1b98ea4791892399d8c23c93e117567eeff38887;p=platform%2Fkernel%2Flinux-arm64.git [ALSA] rawmidi: adjust runtime->avail when changing output buffer size 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 --- diff --git a/sound/core/rawmidi.c b/sound/core/rawmidi.c index e6ee0d8..587ea1e 100644 --- a/sound/core/rawmidi.c +++ b/sound/core/rawmidi.c @@ -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;