From d8ac6074184ffc21c4da8c594df72ee42aa23df2 Mon Sep 17 00:00:00 2001 From: Miika Pekkarinen Date: Wed, 2 Aug 2006 17:39:34 +0000 Subject: Tagcache: Fixed runtime stats not being gathered when tagcache is kept on disk. Initial attempt to make tagcache thread safe. Replaced a few direct buffer allocations with buffer_alloc from tagcache and dircache where possible. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10415 a1c6a512-1295-4272-9138-f99709370657 --- apps/tagtree.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'apps/tagtree.c') diff --git a/apps/tagtree.c b/apps/tagtree.c index b5ec10b04f..4061e9d8d7 100644 --- a/apps/tagtree.c +++ b/apps/tagtree.c @@ -379,11 +379,17 @@ static void tagtree_unbuffer_event(struct mp3entry *id3, bool last_track) /* Do not gather data unless proper setting has been enabled. */ if (!global_settings.runtimedb) + { + logf("runtimedb gathering not enabled"); return; + } /* Don't process unplayed tracks. */ if (id3->elapsed == 0) + { + logf("not logging unplayed track"); return; + } if (!tagcache_find_index(&tcs, id3->path)) { @@ -399,7 +405,11 @@ static void tagtree_unbuffer_event(struct mp3entry *id3, bool last_track) lastplayed = tagcache_increase_serial(); if (lastplayed < 0) + { + logf("incorrect tc serial:%d", lastplayed); + tagcache_search_finish(&tcs); return; + } /* Ignore the last 15s (crossfade etc.) */ playtime += MIN(id3->length, id3->elapsed + 15 * 1000); -- cgit v1.2.3