aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/alsa/alsa-softmixer.h
diff options
context:
space:
mode:
authorThierry Bultel <thierry.bultel@iot.bzh>2019-02-13 11:59:45 +0100
committerThierry Bultel <thierry.bultel@iot.bzh>2019-02-18 15:51:30 +0100
commit297aa8309743d570b801e917f637937c0fc904c7 (patch)
tree85d41c16bc9d84410ad96a7a66ebadae9bcd9692 /plugins/alsa/alsa-softmixer.h
parentc0c670aab4d1cb87f7f49031ec8728d6f1701fe3 (diff)
pcm plugs: rework the alsa config cleanup
The alsa config (for softvol, routes, rate conversion ...) was cleaned up by the owner stream or zone, at their deletion time. This was a mistake, because when the stream or zone creation was not complete, the cleanup of the configuration was not done. Instead of doing that, the config is attached to the plug objects as private data (in the AlsaPcmCtlT structure). Since the AlsaPcmCtlT are always recorded in the creation transaction, it is easy to call the cleaning callback (when it exists) when the transaction is deleted. Change-Id: I952871518a20bfe0be6398887bc747338cf574fb Signed-off-by: Thierry Bultel <thierry.bultel@iot.bzh>
Diffstat (limited to 'plugins/alsa/alsa-softmixer.h')
-rw-r--r--plugins/alsa/alsa-softmixer.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/plugins/alsa/alsa-softmixer.h b/plugins/alsa/alsa-softmixer.h
index 376635a..9710dd3 100644
--- a/plugins/alsa/alsa-softmixer.h
+++ b/plugins/alsa/alsa-softmixer.h
@@ -128,6 +128,9 @@ typedef struct {
bool closeAtDeletion; // intermediate pcms in the pcm chain must not be closed, else it make libasound abort()
bool isPcmPlug;
+
+ void * private_data;
+ void (*private_data_clean) (struct SoftMixerT_ *, void *);
unsigned int quirks;
} AlsaPcmCtlT;
@@ -224,14 +227,17 @@ typedef struct {
int ccount;
AlsaPcmHwInfoT *params;
struct cds_list_head list;
- snd_config_t * routeConfig;
+
bool isPcmPlug;
unsigned int quirks;
} AlsaSndZoneT;
+
/* This is a list of known sound card (hardware or driver) specific bugs */
+
/* - do not trust the result of snd_pcm_poll_descriptors_revents */
#define QUIRK_BOGUS_POLL_REVENTS_DEMANGLING (1<<0)
+
typedef struct {
const char *uid;
const char *verb;
@@ -286,8 +292,6 @@ typedef struct AlsaStreamAudioT_ {
struct cds_list_head list; /* link to the global list*/
AlsaPcmCtlT * softvol;
- snd_config_t * softvolConfig;
- snd_config_t * rateConfig;
void * verbApiHandle;
bool optional;
bool noHwDetected;