bluez5: aac, lc3plus: report bitpool changes

Behavior similar to SBC. This makes return value useful for media-sink logger.
This commit is contained in:
Dmitry Sharshakov 2022-11-07 18:12:42 +03:00 committed by Wim Taymans
parent 1bea58c20b
commit 02a4758043
2 changed files with 7 additions and 5 deletions

View file

@ -610,7 +610,7 @@ static int codec_change_bitrate(struct impl *this, int new_bitrate)
if (res != AACENC_OK)
return -EINVAL;
return 0;
return this->cur_bitrate;
}
static int codec_reduce_bitpool(void *data)

View file

@ -747,15 +747,17 @@ static SPA_UNUSED int codec_decode(void *data,
static int codec_reduce_bitpool(void *data)
{
struct impl *this = data;
this->e.next_bitrate = this->bitrate * 3 / 4;
return 0;
this->e.next_bitrate = SPA_CLAMP(this->bitrate * 3 / 4,
BITRATE_MIN * this->channels, BITRATE_MAX * this->channels);
return this->e.next_bitrate;
}
static int codec_increase_bitpool(void *data)
{
struct impl *this = data;
this->e.next_bitrate = this->bitrate * 5 / 4;
return 0;
this->e.next_bitrate = SPA_CLAMP(this->bitrate * 5 / 4,
BITRATE_MIN * this->channels, BITRATE_MAX * this->channels);
return this->e.next_bitrate;
}
const struct media_codec a2dp_codec_lc3plus_hr = {