Skip to content

Commit

Permalink
[ALSA] rawmidi: adjust runtime->avail when changing output buffer size
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Clemens Ladisch authored and Jaroslav Kysela committed Jan 3, 2006
1 parent 0ef797c commit 1b98ea4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions sound/core/rawmidi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1b98ea4

Please sign in to comment.