mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-10 13:30:05 -05:00
pipewiresink: use maximum size of buffers to configure pool
For encoded formats, buffer size is the size of the actual data in the buffer and may change for each frame depending on the content. Thus, configuring the buffer pool of the pipewiresrc with the size of the first buffer may be insufficient for later buffers. Configure the buffer pool to the maximum size of the first upstream buffer and assume that the following buffers will be allocated with the same size as the first buffer.
This commit is contained in:
parent
efa08e9892
commit
e4def0ce18
1 changed files with 5 additions and 1 deletions
|
|
@ -677,7 +677,11 @@ gst_pipewire_sink_render (GstBaseSink * bsink, GstBuffer * buffer)
|
|||
config = gst_buffer_pool_get_config (GST_BUFFER_POOL_CAST (pwsink->pool));
|
||||
gst_buffer_pool_config_get_params (config, &caps, &size, &min_buffers, &max_buffers);
|
||||
|
||||
size = (size == 0) ? gst_buffer_get_size (buffer) : size;
|
||||
if (size == 0) {
|
||||
gsize maxsize;
|
||||
gst_buffer_get_sizes (buffer, NULL, &maxsize);
|
||||
size = maxsize;
|
||||
}
|
||||
|
||||
gst_buffer_pool_config_set_params (config, caps, size, min_buffers, max_buffers);
|
||||
gst_buffer_pool_set_config (GST_BUFFER_POOL_CAST (pwsink->pool), config);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue