[alsa-lib][PATCH] topology: Fix to skip writing of header for compound elements

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: GuruprasadX Pawse <guruprasadx.pawse@xxxxxxxxx>

While calculating the size of data to be written into the topology
binary file, the size of the compound elements is added as well. This
results in wrong file offset calculation and topology build failure.

The compound elements shouldn't be written to the topology as these are
already embedded as part of other elements. So, skip adding the size of
compound elements to the file offset size calculation.

Signed-off-by: GuruprasadX Pawse <guruprasadx.pawse@xxxxxxxxx>
Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@xxxxxxxxx>
Signed-off-by: Guneshwor Singh <guneshwor.o.singh@xxxxxxxxx>
---
 src/topology/builder.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/topology/builder.c b/src/topology/builder.c
index 997df0c7..5ae3ae89 100644
--- a/src/topology/builder.c
+++ b/src/topology/builder.c
@@ -95,6 +95,10 @@ static int write_elem_block(snd_tplg_t *tplg,
 	list_for_each(pos, base) {
 		/* find elems with the same index to make a block */
 		elem = list_entry(pos, struct tplg_elem, list);
+
+		if (elem->compound_elem)
+			continue;
+
 		elem_next = list_entry(pos->next, struct tplg_elem, list);
 		block_size += elem->size;
 		count++;
-- 
2.15.1

_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux