pulse-server: remove MIN_BLOCK

It is not really used and minreq is good enough
This commit is contained in:
Wim Taymans 2021-02-23 12:29:39 +01:00
parent ab45b16a05
commit 8712cfb6a1
2 changed files with 3 additions and 6 deletions

View file

@ -47,7 +47,6 @@
#define MIN_BUFFERS 8u #define MIN_BUFFERS 8u
#define MAX_BUFFERS 64u #define MAX_BUFFERS 64u
#define MIN_BLOCK 64u
#define MIN_SAMPLES 32u #define MIN_SAMPLES 32u
#define MIN_USEC (MIN_SAMPLES * SPA_USEC_PER_SEC / 48000u) #define MIN_USEC (MIN_SAMPLES * SPA_USEC_PER_SEC / 48000u)

View file

@ -196,7 +196,6 @@ struct stream {
struct channel_map map; struct channel_map map;
struct buffer_attr attr; struct buffer_attr attr;
uint32_t frame_size; uint32_t frame_size;
uint32_t minblock;
uint32_t rate; uint32_t rate;
struct volume volume; struct volume volume;
@ -1125,9 +1124,9 @@ static void fix_playback_buffer_attr(struct stream *s, struct buffer_attr *attr)
s->missing = attr->tlength; s->missing = attr->tlength;
attr->fragsize = 0; attr->fragsize = 0;
pw_log_info(NAME" %p: [%s] maxlength:%u tlength:%u minreq:%u prebuf:%u minblock:%u", s, pw_log_info(NAME" %p: [%s] maxlength:%u tlength:%u minreq:%u prebuf:%u", s,
s->client->name, attr->maxlength, attr->tlength, s->client->name, attr->maxlength, attr->tlength,
attr->minreq, attr->prebuf, s->minblock); attr->minreq, attr->prebuf);
} }
static int reply_create_playback_stream(struct stream *stream) static int reply_create_playback_stream(struct stream *stream)
@ -1477,7 +1476,6 @@ static void stream_param_changed(void *data, uint32_t id, const struct spa_pod *
pw_stream_set_error(stream->stream, res, "format not supported"); pw_stream_set_error(stream->stream, res, "format not supported");
return; return;
} }
stream->minblock = MIN_BLOCK * stream->frame_size;
stream->rate = stream->ss.rate; stream->rate = stream->ss.rate;
if (stream->create_tag != SPA_ID_INVALID) { if (stream->create_tag != SPA_ID_INVALID) {
@ -1649,7 +1647,7 @@ static void stream_process(void *data)
if (stream->rate_match) if (stream->rate_match)
minreq = stream->rate_match->size * stream->frame_size; minreq = stream->rate_match->size * stream->frame_size;
else else
minreq = SPA_MAX(stream->minblock, stream->attr.minreq); minreq = stream->attr.minreq;
if (avail < (int32_t)minreq || stream->corked) { if (avail < (int32_t)minreq || stream->corked) {
/* underrun, produce a silence buffer */ /* underrun, produce a silence buffer */