summaryrefslogtreecommitdiff
path: root/apps/tagtree.c
diff options
context:
space:
mode:
authorMiika Pekkarinen <miipekk@ihme.org>2006-08-02 17:39:34 +0000
committerMiika Pekkarinen <miipekk@ihme.org>2006-08-02 17:39:34 +0000
commitd8ac6074184ffc21c4da8c594df72ee42aa23df2 (patch)
treec42203d8bf2c7e85a9886616f0268250dbe5e9d6 /apps/tagtree.c
parentd68ae6a7a62e0a32cfc84200092985910c0fd099 (diff)
downloadrockbox-d8ac6074184ffc21c4da8c594df72ee42aa23df2.tar.gz
rockbox-d8ac6074184ffc21c4da8c594df72ee42aa23df2.zip
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
Diffstat (limited to 'apps/tagtree.c')
-rw-r--r--apps/tagtree.c10
1 files changed, 10 insertions, 0 deletions
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)
379 379
380 /* Do not gather data unless proper setting has been enabled. */ 380 /* Do not gather data unless proper setting has been enabled. */
381 if (!global_settings.runtimedb) 381 if (!global_settings.runtimedb)
382 {
383 logf("runtimedb gathering not enabled");
382 return; 384 return;
385 }
383 386
384 /* Don't process unplayed tracks. */ 387 /* Don't process unplayed tracks. */
385 if (id3->elapsed == 0) 388 if (id3->elapsed == 0)
389 {
390 logf("not logging unplayed track");
386 return; 391 return;
392 }
387 393
388 if (!tagcache_find_index(&tcs, id3->path)) 394 if (!tagcache_find_index(&tcs, id3->path))
389 { 395 {
@@ -399,7 +405,11 @@ static void tagtree_unbuffer_event(struct mp3entry *id3, bool last_track)
399 405
400 lastplayed = tagcache_increase_serial(); 406 lastplayed = tagcache_increase_serial();
401 if (lastplayed < 0) 407 if (lastplayed < 0)
408 {
409 logf("incorrect tc serial:%d", lastplayed);
410 tagcache_search_finish(&tcs);
402 return; 411 return;
412 }
403 413
404 /* Ignore the last 15s (crossfade etc.) */ 414 /* Ignore the last 15s (crossfade etc.) */
405 playtime += MIN(id3->length, id3->elapsed + 15 * 1000); 415 playtime += MIN(id3->length, id3->elapsed + 15 * 1000);