From 79bed1f422a79a18e40443b9ada647aeb1c0cc61 Mon Sep 17 00:00:00 2001 From: William Wilgus Date: Wed, 11 Sep 2024 22:36:42 -0400 Subject: RFC skin_tokens remove a static buffer it was hard to hit this branch, I had to comment out: ln 555 else if (offset == 1) ln 556 pid3 = state->nid3; as far as I can tell the reason for the separate filename buffer was due to the failure mode of audio_peek_track() wiping the id3->path, stands to reason for me that we can just fill it again -Already found a gotcha playlist_peek() mutates the buffer makes me like this solution less, might rework tagcache_fill_tags() instead --Fixed Change-Id: I4a2ee71a8e2d0739c9e141948b71c2ed36296e3b --- apps/tagcache.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'apps/tagcache.c') diff --git a/apps/tagcache.c b/apps/tagcache.c index 1412647368..5bfeb82481 100644 --- a/apps/tagcache.c +++ b/apps/tagcache.c @@ -2085,13 +2085,18 @@ bool tagcache_fill_tags(struct mp3entry *id3, const char *filename) return false; /* Find the corresponding entry in tagcache. */ + + if (filename != NULL) + memset(id3, 0, sizeof(struct mp3entry)); + else /* Note: caller clears id3 prior to call */ + filename = id3->path; + idx_id = find_entry_ram(filename); if (idx_id < 0) return false; entry = &tcramcache.hdr->indices[idx_id]; - - memset(id3, 0, sizeof(struct mp3entry)); + char* buf = id3->id3v2buf; ssize_t remaining = sizeof(id3->id3v2buf); -- cgit v1.2.3