mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2026-03-03 01:40:08 -05:00
rawmidi: return ENOTSUP when timestamp reads are not supported by plugins
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
5ac6198376
commit
c578e80d6f
1 changed files with 4 additions and 0 deletions
|
|
@ -844,6 +844,8 @@ int snd_rawmidi_params_set_read_mode(const snd_rawmidi_t *rawmidi, snd_rawmidi_p
|
||||||
framing = SNDRV_RAWMIDI_MODE_FRAMING_NONE;
|
framing = SNDRV_RAWMIDI_MODE_FRAMING_NONE;
|
||||||
break;
|
break;
|
||||||
case SND_RAWMIDI_READ_TSTAMP:
|
case SND_RAWMIDI_READ_TSTAMP:
|
||||||
|
if (rawmidi->ops->tread == NULL)
|
||||||
|
return -ENOTSUP;
|
||||||
framing = SNDRV_RAWMIDI_MODE_FRAMING_TSTAMP;
|
framing = SNDRV_RAWMIDI_MODE_FRAMING_TSTAMP;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
@ -1114,5 +1116,7 @@ ssize_t snd_rawmidi_tread(snd_rawmidi_t *rawmidi, struct timespec *tstamp, void
|
||||||
assert(buffer || size == 0);
|
assert(buffer || size == 0);
|
||||||
if ((rawmidi->params_mode & SNDRV_RAWMIDI_MODE_FRAMING_MASK) == SNDRV_RAWMIDI_MODE_FRAMING_TSTAMP)
|
if ((rawmidi->params_mode & SNDRV_RAWMIDI_MODE_FRAMING_MASK) == SNDRV_RAWMIDI_MODE_FRAMING_TSTAMP)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
if (rawmidi->ops->tread == NULL)
|
||||||
|
return -ENOTSUP;
|
||||||
return (rawmidi->ops->tread)(rawmidi, tstamp, buffer, size);
|
return (rawmidi->ops->tread)(rawmidi, tstamp, buffer, size);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue