From 6632d6e2872ef587f15331abe548efece10a6ba6 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 6 Jan 2018 15:55:13 +0100 Subject: [PATCH] cache: fix --cache-initial status message For quite some time, msg.c hasn't output partial log messages anymore, and instead buffered them in memory. This means the MP_INFO() statement here just kept appending the message to memory, instead of outputting it. Easy enough to fix by abusing the status line (which means the frontend and this code will "fight" for the status line, but this code seems to win usually, as the frontend doesn't update it so often). Users should probably really switch to --cache-pause-initial. Fixes #5360. --- stream/cache.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/stream/cache.c b/stream/cache.c index 10e1bd7ce7..fb7927f0b1 100644 --- a/stream/cache.c +++ b/stream/cache.c @@ -790,9 +790,9 @@ int stream_cache_init(stream_t *cache, stream_t *stream, struct stream_cache_info info; if (stream_control(s->cache, STREAM_CTRL_GET_CACHE_INFO, &info) < 0) break; - MP_INFO(s, "\rCache fill: %5.2f%% " - "(%" PRId64 " bytes) ", 100.0 * info.fill / s->buffer_size, - info.fill); + mp_msg(s->log, MSGL_STATUS, "Cache fill: %5.2f%% " + "(%" PRId64 " bytes)", 100.0 * info.fill / s->buffer_size, + info.fill); if (info.fill >= min) break; if (info.idle) @@ -804,6 +804,5 @@ int stream_cache_init(stream_t *cache, stream_t *stream, cache_wakeup_and_wait(s, &(double){0}); pthread_mutex_unlock(&s->mutex); } - MP_INFO(s, "\n"); return 1; }