mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-31 22:25:35 -04:00
pcm: fix __snd_pcm_state() return value
The __snd_pcm_state() must return a valid state, not an error value when the plugin callback is not defined. Use the first state SND_PCM_STATE_OPEN - the other functions will return the error code depending on this state. Link: https://lore.kernel.org/alsa-devel/20201226213547.175071-10-alexhenrie24@gmail.com/ Reported-by: Alex Henrie <alexhenrie24@gmail.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
9ebd29d2d3
commit
36aff79747
1 changed files with 1 additions and 1 deletions
|
|
@ -444,7 +444,7 @@ static inline int __snd_pcm_start(snd_pcm_t *pcm)
|
|||
static inline snd_pcm_state_t __snd_pcm_state(snd_pcm_t *pcm)
|
||||
{
|
||||
if (!pcm->fast_ops->state)
|
||||
return -ENOSYS;
|
||||
return SND_PCM_STATE_OPEN;
|
||||
return pcm->fast_ops->state(pcm->fast_op_arg);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue