Index: trunk/apps/bookmark.c =================================================================== --- trunk.orig/apps/bookmark.c +++ trunk/apps/bookmark.c @@ -102,7 +102,7 @@ static int buffer_bookmarks(struct bookm static char* get_bookmark_info(int list_index, void* data, char *buffer); static char* select_bookmark(const char* bookmark_file_name, bool show_dont_resume, bool is_mrb); static bool system_check(void); -static bool write_bookmark(bool create_bookmark_file); +static bool write_bookmark(bool create_bookmark_file, char *bookmark); static int get_bookmark_count(const char* bookmark_file_name); static char global_temp_buffer[MAX_PATH+1]; @@ -119,7 +119,10 @@ static char global_filename[MAX_PATH]; /* ----------------------------------------------------------------------- */ bool bookmark_create_menu(void) { - write_bookmark(true); + if(!system_check()) + return false; + gui_syncsplash(0, ID2P(LANG_WAIT)); + write_bookmark(true, create_bookmark()); return false; } @@ -171,20 +174,23 @@ bool bookmark_mrb_load() /* ----------------------------------------------------------------------- */ bool bookmark_autobookmark(void) { + char* bookmark; if (!system_check()) return false; audio_pause(); /* first pause playback */ + bookmark = create_bookmark(); + audio_stop(); switch (global_settings.autocreatebookmark) { case BOOKMARK_YES: - return write_bookmark(true); + return write_bookmark(true, bookmark); case BOOKMARK_NO: return false; case BOOKMARK_RECENT_ONLY_YES: - return write_bookmark(false); + return write_bookmark(false, bookmark); } #ifdef HAVE_LCD_BITMAP unsigned char *lines[]={ID2P(LANG_AUTO_BOOKMARK_QUERY)}; @@ -204,9 +210,9 @@ bool bookmark_autobookmark(void) if(gui_syncyesno_run(&message, NULL, NULL)==YESNO_YES) { if (global_settings.autocreatebookmark == BOOKMARK_RECENT_ONLY_ASK) - return write_bookmark(false); + return write_bookmark(false, bookmark); else - return write_bookmark(true); + return write_bookmark(true, bookmark); } return false; } @@ -218,15 +224,10 @@ bool bookmark_autobookmark(void) /* resume_index*resume_offset*resume_seed*resume_first_index* */ /* resume_file*milliseconds*MP3 Title* */ /* ------------------------------------------------------------------------*/ -static bool write_bookmark(bool create_bookmark_file) +static bool write_bookmark(bool create_bookmark_file, char *bookmark) { bool success=false; - char* bookmark; - if (!system_check()) - return false; /* something didn't happen correctly, do nothing */ - - bookmark = create_bookmark(); if (!bookmark) return false; /* something didn't happen correctly, do nothing */