Add log level argument to ratelimit_test function

If a log message is rate limited, we only need to know about it if we
are actually interested in that log level. We therefore add an argument
to the ratelimit_test function to set the log level of the message
printed if a message is skipped

Change-Id: I5ccd4a78bf7e972fe8b0e7133cd7e08c1e38835f
This commit is contained in:
Torkel Niklasson 2021-08-12 16:56:10 +02:00 committed by Wim Taymans
parent be6824cb15
commit eff67c3c03
3 changed files with 5 additions and 5 deletions

View file

@ -140,7 +140,7 @@ int stream_send_underflow(struct stream *stream, int64_t offset, uint32_t underr
struct impl *impl = client->impl;
struct message *reply;
if (ratelimit_test(&impl->rate_limit, stream->timestamp)) {
if (ratelimit_test(&impl->rate_limit, stream->timestamp, SPA_LOG_LEVEL_INFO)) {
pw_log_info("client %p [%s]: stream %p UNDERFLOW channel:%u offset:%" PRIi64 " underrun:%u",
client, client->name, stream, stream->channel, offset, underrun_for);
}