From cacc64a4feef33dfd2aef2a1092f110ac196382b Mon Sep 17 00:00:00 2001 From: Michael Giacomelli Date: Sun, 2 Jan 2011 03:48:40 +0000 Subject: Blind commit a 'fix' for automatic resume on HWCODEC since I don't understand HWCODEC and have no way to test builds for it. For now just disable it. In the long term it would be nice to support this on HWCODEC, or failing that, clean this up a little more. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28943 a1c6a512-1295-4272-9138-f99709370657 --- apps/menus/settings_menu.c | 4 ++++ apps/settings_list.c | 2 ++ apps/tagcache.c | 2 ++ apps/tagtree.c | 10 ++++++++-- 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/apps/menus/settings_menu.c b/apps/menus/settings_menu.c index e609a4032e..cc3871a4d6 100644 --- a/apps/menus/settings_menu.c +++ b/apps/menus/settings_menu.c @@ -425,8 +425,10 @@ MAKE_MENU(hotkey_menu, ID2P(LANG_HOTKEY), 0, Icon_NOICON, /* SETTINGS MENU */ #ifdef HAVE_TAGCACHE +#if CONFIG_CODEC == SWCODEC MENUITEM_SETTING(autoresume_enable, &global_settings.autoresume_enable, NULL); #endif +#endif static struct browse_folder_info langs = { LANG_DIR, SHOW_LNG }; @@ -442,7 +444,9 @@ MAKE_MENU(settings_menu_item, ID2P(LANG_GENERAL_SETTINGS), 0, &display_menu, &system_menu, &bookmark_settings_menu, #ifdef HAVE_TAGCACHE +#if CONFIG_CODEC == SWCODEC &autoresume_enable, +#endif #endif &browse_langs, &voice_settings_menu, #ifdef HAVE_HOTKEY diff --git a/apps/settings_list.c b/apps/settings_list.c index 3da5f1db62..39de65c381 100644 --- a/apps/settings_list.c +++ b/apps/settings_list.c @@ -1257,11 +1257,13 @@ const struct settings_list settings[] = { ID2P(LANG_RANDOM)), #ifdef HAVE_TAGCACHE +#if CONFIG_CODEC == SWCODEC BOOL_SETTING(0, autoresume_enable, LANG_AUTORESUME_ENABLE, false, "autoresume enable", off_on, LANG_AUTORESUME_ENABLE_YES, LANG_SET_BOOL_NO, NULL), OFFON_SETTING(0, runtimedb, LANG_RUNTIMEDB_ACTIVE, false, "gather runtime data", NULL), +#endif #endif #if CONFIG_CODEC == SWCODEC diff --git a/apps/tagcache.c b/apps/tagcache.c index 1d90eee24b..b3a16a3c42 100644 --- a/apps/tagcache.c +++ b/apps/tagcache.c @@ -1695,12 +1695,14 @@ bool tagcache_fill_tags(struct mp3entry *id3, const char *filename) if (id3->bitrate == 0) id3->bitrate = 1; +#if CONFIG_CODEC == SWCODEC if (global_settings.autoresume_enable) { id3->offset = get_tag_numeric(entry, tag_lastoffset, idx_id); logf("tagcache_fill_tags: Set offset for %s to %lX\n", id3->title, id3->offset); } +#endif return true; } diff --git a/apps/tagtree.c b/apps/tagtree.c index 8ebac0b3a5..4673af38cf 100644 --- a/apps/tagtree.c +++ b/apps/tagtree.c @@ -170,7 +170,9 @@ static int current_entry_count; static struct tree_context *tc; +#if CONFIG_CODEC == SWCODEC extern bool automatic_skip; /* Who initiated in-progress skip? (C/A-) */ +#endif static int get_token_str(char *buf, int size) { @@ -677,7 +679,8 @@ static void tagtree_buffer_event(void *data) logf("-> %ld/%ld", id3->playcount, id3->playtime); } - + + #if CONFIG_CODEC == SWCODEC if (global_settings.autoresume_enable) { /* Load current file resume offset if not already defined (by @@ -690,7 +693,8 @@ static void tagtree_buffer_event(void *data) str_or_empty(id3->title), id3->offset); } } - + #endif + /* Store our tagcache index pointer. */ id3->tagcache_idx = tcs.idx_id+1; @@ -753,6 +757,7 @@ static void tagtree_track_finish_event(void *data) tagcache_update_numeric(tagcache_idx, tag_lastplayed, lastplayed); } +#if CONFIG_CODEC == SWCODEC if (global_settings.autoresume_enable) { unsigned long offset @@ -763,6 +768,7 @@ static void tagtree_track_finish_event(void *data) logf("tagtree_track_finish_event: Save offset for %s: %lX", str_or_empty(id3->title), offset); } +#endif } bool tagtree_export(void) -- cgit v1.2.3