buffer: add EMPTY chunk flag

Add an EMPTY chunk flag to mark a piece of memory as 'empty'. For audio
this means silence.
Use the empty flag to avoid mixing 0 samples.
Set the empty flag in output buffers on audioconvert.
This commit is contained in:
Wim Taymans 2022-06-24 11:09:01 +02:00
parent 71f3c759f4
commit f2dee23085
4 changed files with 18 additions and 5 deletions

View file

@ -63,6 +63,9 @@ struct spa_chunk {
int32_t stride; /**< stride of valid data */
#define SPA_CHUNK_FLAG_NONE 0
#define SPA_CHUNK_FLAG_CORRUPTED (1u<<0) /**< chunk data is corrupted in some way */
#define SPA_CHUNK_FLAG_EMPTY (1u<<1) /**< chunk data is empty with media specific
* neutral data such as silence or black. This
* could be used to optimize processing. */
int32_t flags; /**< chunk flags */
};