mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-04 13:30:08 -05:00
rawmidi: free framing read bufffer when the framing mode becomes inactive
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
c932c1e7ab
commit
392d5b06f8
1 changed files with 6 additions and 0 deletions
|
|
@ -114,6 +114,12 @@ static int snd_rawmidi_hw_params(snd_rawmidi_t *rmidi, snd_rawmidi_params_t * pa
|
|||
return -errno;
|
||||
}
|
||||
buf_reset(hw);
|
||||
if (hw->buf &&
|
||||
((params->mode & SNDRV_RAWMIDI_MODE_FRAMING_MASK) != SNDRV_RAWMIDI_MODE_FRAMING_TSTAMP)) {
|
||||
free(hw->buf);
|
||||
hw->buf = NULL;
|
||||
hw->buf_size = 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue