adapter: add Header metadata by default

Firefox needs this but we should eventually check the Meta Params to
decide on this.
This commit is contained in:
Wim Taymans 2025-03-26 17:22:11 +01:00
parent 81408597f4
commit 8d7175a1e7

View file

@ -403,6 +403,7 @@ static int negotiate_buffers(struct impl *this)
uint32_t i, size, buffers, blocks, align, flags, stride = 0;
uint32_t *aligns;
struct spa_data *datas;
struct spa_meta metas[1];
uint64_t follower_flags, conv_flags;
spa_log_debug(this->log, "%p: n_buffers:%d", this, this->n_buffers);
@ -484,9 +485,11 @@ static int negotiate_buffers(struct impl *this)
datas[i].maxsize = size;
aligns[i] = align;
}
metas[0].type = SPA_META_Header;
metas[0].size = sizeof(struct spa_meta_header);
free(this->buffers);
this->buffers = spa_buffer_alloc_array(buffers, flags, 0, NULL, blocks, datas, aligns);
this->buffers = spa_buffer_alloc_array(buffers, flags, 1, metas, blocks, datas, aligns);
if (this->buffers == NULL)
return -errno;
this->n_buffers = buffers;