From fff6e5abaf788251bd0483e892a5a33dec75efec Mon Sep 17 00:00:00 2001 From: Donat Zenichev Date: Mon, 25 May 2026 13:34:47 +0200 Subject: [PATCH] MT#61856 media_player: calculate cache times in us The only caller of `media_player_get_cache_times()` does comparisons based on microseconds, but the called function to calculate `mtime` and `atime` does this in seconds. Hence the result is used incorrectly, because it compares that value against `rtpe_now - rtpe_config.db_expire_us`, which is again in microseconds. Change-Id: Iea4b5b1c6d36c202bdce477ee8147e84e1974210 --- daemon/media_player.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/daemon/media_player.c b/daemon/media_player.c index bb9270a35..8a64abe1a 100644 --- a/daemon/media_player.c +++ b/daemon/media_player.c @@ -2664,6 +2664,9 @@ GQueue media_player_list_caches(void) { return ret; } +/** + * Returns mtime and atime in microseconds. + */ bool media_player_get_cache_times(unsigned long long id, int64_t *mtime, int64_t *atime) { #ifdef WITH_TRANSCODING g_autoptr(char) fn = media_player_make_cache_entry_name(id); @@ -2671,8 +2674,8 @@ bool media_player_get_cache_times(unsigned long long id, int64_t *mtime, int64_t int fail = stat(fn, &sb); if (fail) return false; - *mtime = sb.st_mtim.tv_sec; - *atime = sb.st_atim.tv_sec; + *mtime = (sb.st_mtim.tv_sec) * 1000000LL; + *atime = (sb.st_atim.tv_sec) * 1000000LL; return true; #else return false;