summaryrefslogtreecommitdiffstats
path: root/plugins/alsa/alsa-transaction.c
diff options
context:
space:
mode:
authorMark Farrugia <mark.farrugia@fiberdyne.com.au>2019-04-09 10:40:10 +1000
committerMark Farrugia <mark.farrugia@fiberdyne.com.au>2019-04-09 10:40:10 +1000
commit7687aea64ee6505818a563b6aa42303ab9be2e78 (patch)
treed29b662f4e5e4713536feef2397d188d9bb277de /plugins/alsa/alsa-transaction.c
parent36721c55b616bdce8b8f79ff3c7042ef54d18478 (diff)
Updates for latest libavirt, adds avirt cleanup
Cleanup for avirt is introduced. There are still some issues with this when invoked whilst a PCM is active, This now allows 4A to be restarted without a reboot. Loops must be deleted last to avoid any cleanup issues, so to enforce this a new transaction API is added: AlsaMixerTransactionObjectAddTail. Change-Id: Ieac6a2f163f40af55ee3c33ab63cc534df88769a Signed-off-by: Mark Farrugia <mark.farrugia@fiberdyne.com.au>
Diffstat (limited to 'plugins/alsa/alsa-transaction.c')
-rw-r--r--plugins/alsa/alsa-transaction.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/plugins/alsa/alsa-transaction.c b/plugins/alsa/alsa-transaction.c
index c35ea81..f8affa6 100644
--- a/plugins/alsa/alsa-transaction.c
+++ b/plugins/alsa/alsa-transaction.c
@@ -71,6 +71,27 @@ fail:
}
+bool AlsaMixerTransactionObjectAddTail(AlsaMixerTransaction* list, void* object, AlsaTransactionDestructor destructor) {
+ bool ret = false;
+ AlsaMixerTransactionDataItem * newItem = NULL;
+ if (!list)
+ goto fail;
+
+ newItem = (AlsaMixerTransactionDataItem *) malloc(sizeof(AlsaMixerTransactionDataItem));
+ if (newItem == NULL)
+ goto fail;
+
+ CDS_INIT_LIST_HEAD(&newItem->list_entry);
+ newItem->object = object;
+ newItem->destructor = destructor;
+ cds_list_add_tail(&newItem->list_entry, &list->item_list);
+
+ ret = true;
+fail:
+ return ret;
+
+}
+
static void AlsaMixerTransactionDoCleanup(AlsaMixerTransaction* transaction) {
AlsaMixerTransactionDataItem * item, *sav;