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
|
|
@ -33,9 +33,6 @@
|
|||
#include <fcntl.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include "control_local.h"
|
||||
#ifdef SUPPORT_RESMGR
|
||||
#include <resmgr.h>
|
||||
#endif
|
||||
|
||||
#ifndef DOC_HIDDEN
|
||||
#define SND_FILE_CONTROL "/dev/snd/controlC%i"
|
||||
|
|
@ -54,19 +51,11 @@ int snd_card_load(int card)
|
|||
|
||||
sprintf(control, SND_FILE_CONTROL, card);
|
||||
|
||||
#ifdef SUPPORT_RESMGR
|
||||
open_dev = rsm_open_device(control, O_RDONLY);
|
||||
#else
|
||||
open_dev = open(control, O_RDONLY);
|
||||
#endif
|
||||
open_dev = snd_open_device(control, O_RDONLY);
|
||||
if (open_dev < 0) {
|
||||
char aload[32];
|
||||
sprintf(aload, SND_FILE_LOAD, card);
|
||||
#ifdef SUPPORT_RESMGR
|
||||
open_dev = rsm_open_device(aload, O_RDONLY);
|
||||
#else
|
||||
open_dev = open(aload, O_RDONLY);
|
||||
#endif
|
||||
open_dev = snd_open_device(aload, O_RDONLY);
|
||||
}
|
||||
if (open_dev >= 0) {
|
||||
close (open_dev);
|
||||
|
|
|
|||
|
|
@ -28,9 +28,6 @@
|
|||
#include <fcntl.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include "control_local.h"
|
||||
#ifdef SUPPORT_RESMGR
|
||||
#include <resmgr.h>
|
||||
#endif
|
||||
|
||||
#ifndef PIC
|
||||
/* entry for static linking */
|
||||
|
|
@ -340,18 +337,10 @@ int snd_ctl_hw_open(snd_ctl_t **handle, const char *name, int card, int mode)
|
|||
fmode |= O_NONBLOCK;
|
||||
if (mode & SND_CTL_ASYNC)
|
||||
fmode |= O_ASYNC;
|
||||
#ifdef SUPPORT_RESMGR
|
||||
fd = rsm_open_device(filename, fmode);
|
||||
#else
|
||||
fd = open(filename, fmode);
|
||||
#endif
|
||||
fd = snd_open_device(filename, fmode);
|
||||
if (fd < 0) {
|
||||
snd_card_load(card);
|
||||
#ifdef SUPPORT_RESMGR
|
||||
fd = rsm_open_device(filename, fmode);
|
||||
#else
|
||||
fd = open(filename, fmode);
|
||||
#endif
|
||||
fd = snd_open_device(filename, fmode);
|
||||
if (fd < 0)
|
||||
return -errno;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue