pulse-server: log the amount of underrun bytes

This commit is contained in:
Wim Taymans 2021-01-28 17:56:07 +01:00
parent 0ccad38df1
commit e172effe71

View file

@ -455,15 +455,15 @@ static int reply_error(struct client *client, uint32_t command, uint32_t tag, in
#include "extension.c" #include "extension.c"
static int send_underflow(struct stream *stream, int64_t offset) static int send_underflow(struct stream *stream, int64_t offset, uint32_t underrun_for)
{ {
struct client *client = stream->client; struct client *client = stream->client;
struct impl *impl = client->impl; struct impl *impl = client->impl;
struct message *reply; struct message *reply;
if (ratelimit_test(&impl->rate_limit, stream->timestamp)) { if (ratelimit_test(&impl->rate_limit, stream->timestamp)) {
pw_log_warn(NAME" %p: [%s] UNDERFLOW channel:%u offset:%"PRIi64, pw_log_warn(NAME" %p: [%s] UNDERFLOW channel:%u offset:%"PRIi64" underrun:%u",
client, client->name, stream->channel, offset); client, client->name, stream->channel, offset, underrun_for);
} }
reply = message_alloc(impl, -1, 0); reply = message_alloc(impl, -1, 0);
@ -1458,7 +1458,7 @@ do_process_done(struct spa_loop *loop,
stream->underrun_for = 0; stream->underrun_for = 0;
stream->playing_for = 0; stream->playing_for = 0;
if (pd->underrun) if (pd->underrun)
send_underflow(stream, pd->read_index); send_underflow(stream, pd->read_index, pd->underrun_for);
else else
send_stream_started(stream); send_stream_started(stream);
} }