mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-16 07:00:00 -05:00
filter: return NULL when no DSP buffer is available
Instead of returning the dummy empty buffer. The dummy buffer is problematic in various ways: 1) it has a fixed hardcoded size and doesn't adapt to the quantum_limit. 2) when used as output buffer, data is written to the void with no indication for the application. 3) using random data as an input buffer is going to cause unexpected noise with no indication to the application.
This commit is contained in:
parent
622851001e
commit
844eee678a
1 changed files with 1 additions and 2 deletions
|
|
@ -52,7 +52,6 @@ PW_LOG_TOPIC_EXTERN(log_filter);
|
||||||
#define MASK_BUFFERS (MAX_BUFFERS-1)
|
#define MASK_BUFFERS (MAX_BUFFERS-1)
|
||||||
#define MAX_PORTS 1024
|
#define MAX_PORTS 1024
|
||||||
|
|
||||||
static float empty[MAX_SAMPLES];
|
|
||||||
static bool mlock_warned = false;
|
static bool mlock_warned = false;
|
||||||
|
|
||||||
static uint32_t mappable_dataTypes = (1<<SPA_DATA_MemFd);
|
static uint32_t mappable_dataTypes = (1<<SPA_DATA_MemFd);
|
||||||
|
|
@ -1860,7 +1859,7 @@ void *pw_filter_get_dsp_buffer(void *port_data, uint32_t n_samples)
|
||||||
struct spa_data *d;
|
struct spa_data *d;
|
||||||
|
|
||||||
if ((buf = pw_filter_dequeue_buffer(port_data)) == NULL)
|
if ((buf = pw_filter_dequeue_buffer(port_data)) == NULL)
|
||||||
return empty;
|
return NULL;
|
||||||
|
|
||||||
d = &buf->buffer->datas[0];
|
d = &buf->buffer->datas[0];
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue