1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
Michael Giacomelli 2011-01-02 03:48:40 +00:00
parent 66e8fc0f0d
commit cacc64a4fe
4 changed files with 16 additions and 2 deletions

View file

@ -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

View file

@ -1257,12 +1257,14 @@ 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
/* replay gain */

View file

@ -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;
}

View file

@ -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)
{
@ -678,6 +680,7 @@ 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,6 +693,7 @@ 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)