sof-ctl: fix ABI dumping doesn't work issue

For dumping to output file without '-r', we need to dump ABI header,
here fix it.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
This commit is contained in:
Keyon Jie 2019-07-16 11:21:22 +08:00 committed by Janusz Jankowski
parent 62035b22fc
commit 720cdcda67
1 changed files with 7 additions and 6 deletions

View File

@ -413,13 +413,14 @@ static void ctl_dump(struct ctl_data *ctl_data)
}
if (ctl_data->binary) {
if (ctl_data->no_abi)
offset = BUFFER_ABI_OFFSET +
sizeof(struct sof_abi_hdr) /
sizeof(int);
n = ctl_data->buffer[BUFFER_SIZE_OFFSET] -
sizeof(struct sof_abi_hdr);
offset = BUFFER_ABI_OFFSET;
n = ctl_data->buffer[BUFFER_SIZE_OFFSET];
if (ctl_data->no_abi) {
offset += sizeof(struct sof_abi_hdr) /
sizeof(int);
n -= sizeof(struct sof_abi_hdr);
}
n = fwrite(&ctl_data->buffer[offset],
1, n, fh);
}