mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-02 09:01:48 -05:00
Fix resmgr support
Call normal open() before trying with res_open_device(). snd_open_device() is defined to do this procedure.
This commit is contained in:
parent
237d46cfb6
commit
f9b9015245
9 changed files with 30 additions and 94 deletions
|
|
@ -26,9 +26,6 @@
|
|||
#include <fcntl.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include "hwdep_local.h"
|
||||
#ifdef SUPPORT_RESMGR
|
||||
#include <resmgr.h>
|
||||
#endif
|
||||
|
||||
#ifndef PIC
|
||||
/* entry for static linking */
|
||||
|
|
@ -118,18 +115,10 @@ int snd_hwdep_hw_open(snd_hwdep_t **handle, const char *name, int card, int devi
|
|||
if (card < 0 || card >= 32)
|
||||
return -EINVAL;
|
||||
sprintf(filename, SNDRV_FILE_HWDEP, card, device);
|
||||
#ifdef SUPPORT_RESMGR
|
||||
fd = rsm_open_device(filename, mode);
|
||||
#else
|
||||
fd = open(filename, mode);
|
||||
#endif
|
||||
fd = snd_open_device(filename, mode);
|
||||
if (fd < 0) {
|
||||
snd_card_load(card);
|
||||
#ifdef SUPPORT_RESMGR
|
||||
fd = rsm_open_device(filename, mode);
|
||||
#else
|
||||
fd = open(filename, mode);
|
||||
#endif
|
||||
fd = snd_open_device(filename, mode);
|
||||
if (fd < 0)
|
||||
return -errno;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue