Skip to contentSkip to conversation

topology: Fix to skip writing of header for compound elements

PATCH Applied Guneshwor Singh 2 participants 2 messages Jan 2, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 topology: Fix to skip writing of header for compound elements

From: GuruprasadX Pawse <[email protected]>

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.

---
 src/topology/builder.c | 4 ++++
 1 file changed, 4 insertions(+)
src/topology/builder.c +4 -0
index 997df0c7..5ae3ae89 100644
@@ -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++;
Signature · 1 line
2.15.1
Applied
#1 lore raw
Quoted 7 lines · Guneshwor Singh

From: GuruprasadX Pawse <[email protected]>

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.

Quoted 7 lines

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.

Applied, thanks.

Takashi