mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-03-02 01:40:31 -05:00
bluez5: fix ISO sequence numbering
Pass zero-length packets to the codec. BAP/ISO may use these to indicate missing data. Fix A2DP codecs to not parse input with spa_return_val_if_fail, that's meant for assertions. Just return -EINVAL directly, it's normal that input data may contain garbage.
This commit is contained in:
parent
02d5d9bc1f
commit
ff81fc9f7b
10 changed files with 31 additions and 11 deletions
|
|
@ -37,6 +37,8 @@ struct impl {
|
|||
int framelen;
|
||||
int samples;
|
||||
unsigned int codesize;
|
||||
|
||||
uint16_t seqnum;
|
||||
};
|
||||
|
||||
struct settings {
|
||||
|
|
@ -1274,13 +1276,23 @@ static int codec_encode(void *data,
|
|||
return processed;
|
||||
}
|
||||
|
||||
static SPA_UNUSED int codec_start_decode (void *data,
|
||||
static int codec_start_decode (void *data,
|
||||
const void *src, size_t src_size, uint16_t *seqnum, uint32_t *timestamp)
|
||||
{
|
||||
struct impl *this = data;
|
||||
|
||||
/* packets come from controller, so also invalid ones bump seqnum */
|
||||
this->seqnum++;
|
||||
|
||||
if (!src_size)
|
||||
return -EINVAL;
|
||||
|
||||
if (*seqnum)
|
||||
*seqnum = this->seqnum;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static SPA_UNUSED int codec_decode(void *data,
|
||||
static int codec_decode(void *data,
|
||||
const void *src, size_t src_size,
|
||||
void *dst, size_t dst_size,
|
||||
size_t *dst_out)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue