1
0
Fork 0
forked from len0rd/rockbox

FS#7971 - mpegplayer - start menu loads quicker - menu clean up - code clean up

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15143 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Robert Kukla 2007-10-16 14:23:50 +00:00
parent 94c23df2ab
commit 0b911fefea
4 changed files with 264 additions and 237 deletions

View file

@ -54,8 +54,6 @@ static void * mpeg_malloc_internal (unsigned char *mallocbuf,
x = &mallocbuf[*mem_ptr]; x = &mallocbuf[*mem_ptr];
*mem_ptr += (size + 3) & ~3; /* Keep memory 32-bit aligned */ *mem_ptr += (size + 3) & ~3; /* Keep memory 32-bit aligned */
rb->memset(x,0,size);
return x; return x;
(void)reason; (void)reason;
} }
@ -75,7 +73,6 @@ size_t mpeg_alloc_init(unsigned char *buf, size_t mallocsize,
mallocbuf = (char *)(((intptr_t)buf + 15) & ~15); mallocbuf = (char *)(((intptr_t)buf + 15) & ~15);
/* Adjust for real size */ /* Adjust for real size */
bufsize -= mallocbuf - buf; bufsize -= mallocbuf - buf;
rb->memset(buf,0,bufsize);
/* Separate allocator for video */ /* Separate allocator for video */
libmpeg2size = (libmpeg2size + 15) & ~15; libmpeg2size = (libmpeg2size + 15) & ~15;

View file

@ -96,57 +96,81 @@ volatile long thumbDelayTimer;
static struct configdata config[] = static struct configdata config[] =
{ {
{TYPE_INT, 0, 2, &settings.showfps, "Show FPS", NULL, NULL}, {TYPE_INT, 0, 2, &settings.showfps, "Show FPS", NULL, NULL},
{TYPE_INT, 0, 2, &settings.limitfps, "Limit FPS", NULL, NULL}, {TYPE_INT, 0, 2, &settings.limitfps, "Limit FPS", NULL, NULL},
{TYPE_INT, 0, 2, &settings.skipframes, "Skip frames", NULL, NULL}, {TYPE_INT, 0, 2, &settings.skipframes, "Skip frames", NULL, NULL},
{TYPE_INT, 0, INT_MAX, &settings.resume_count, "Resume count",
NULL, NULL},
#if defined(TOSHIBA_GIGABEAT_F) || defined(SANSA_E200) #if defined(TOSHIBA_GIGABEAT_F) || defined(SANSA_E200)
{TYPE_INT, 0, INT_MAX, &settings.displayoptions, "Display options", {TYPE_INT, 0, INT_MAX, &settings.displayoptions, "Display options",
NULL, NULL}, NULL, NULL},
#endif #endif
}; };
enum mpeg_menu_ids
{
__MPEG_OPTION_START = -1,
#if defined(TOSHIBA_GIGABEAT_F) || defined(SANSA_E200)
MPEG_OPTION_DISPLAY_SETTINGS,
#endif
MPEG_OPTION_DISPLAY_FPS,
MPEG_OPTION_LIMIT_FPS,
MPEG_OPTION_SKIP_FRAMES,
MPEG_OPTION_CLEAR_RESUMES,
MPEG_OPTION_QUIT,
};
static const struct opt_items noyes[2] = { static const struct opt_items noyes[2] = {
{ "No", -1 }, { "No", -1 },
{ "Yes", -1 }, { "Yes", -1 },
}; };
#if defined(TOSHIBA_GIGABEAT_F) || defined(SANSA_E200)
static bool set_option_dithering(void)
{
int val = (settings.displayoptions & LCD_YUV_DITHER) ? 1 : 0;
rb->set_option("Dithering", &val, INT, noyes, 2, NULL);
settings.displayoptions = (settings.displayoptions & ~LCD_YUV_DITHER)
| ((val != 0) ? LCD_YUV_DITHER : 0);
rb->lcd_yuv_set_options(settings.displayoptions);
return false;
}
static void display_options(void) static void display_options(void)
{ {
int result;
int menu_id;
int options_quit = 0;
static const struct menu_item items[] = { static const struct menu_item items[] = {
{ "Dithering", set_option_dithering }, #if defined(TOSHIBA_GIGABEAT_F) || defined(SANSA_E200)
[MPEG_OPTION_DITHERING] =
{ "Dithering", NULL },
#endif /* #ifdef TOSHIBA_GIGABEAT_F */
[MPEG_OPTION_DISPLAY_FPS] =
{ "Display FPS", NULL },
[MPEG_OPTION_LIMIT_FPS] =
{ "Limit FPS", NULL },
[MPEG_OPTION_SKIP_FRAMES] =
{ "Skip frames", NULL },
}; };
int m = menu_init(rb, items, ARRAYLEN(items), menu_id = menu_init(rb, items, ARRAYLEN(items),
NULL, NULL, NULL, NULL); NULL, NULL, NULL, NULL);
menu_run(m);
menu_exit(m); rb->button_clear_queue();
}
while(options_quit == 0)
{
result = menu_show(menu_id);
switch (result)
{
#if defined(TOSHIBA_GIGABEAT_F) || defined(SANSA_E200)
case MPEG_OPTION_DITHERING:
result = (settings.displayoptions & LCD_YUV_DITHER) ? 1 : 0;
rb->set_option("Dithering", &result, INT, noyes, 2, NULL);
settings.displayoptions = (settings.displayoptions & ~LCD_YUV_DITHER)
| ((result != 0) ? LCD_YUV_DITHER : 0);
rb->lcd_yuv_set_options(settings.displayoptions);
break;
#endif /* #ifdef TOSHIBA_GIGABEAT_F */ #endif /* #ifdef TOSHIBA_GIGABEAT_F */
case MPEG_OPTION_DISPLAY_FPS:
rb->set_option("Display FPS",&settings.showfps,INT,
noyes, 2, NULL);
break;
case MPEG_OPTION_LIMIT_FPS:
rb->set_option("Limit FPS",&settings.limitfps,INT,
noyes, 2, NULL);
break;
case MPEG_OPTION_SKIP_FRAMES:
rb->set_option("Skip frames",&settings.skipframes,INT,
noyes, 2, NULL);
break;
default:
options_quit=1;
break;
}
}
menu_exit(menu_id);
}
void draw_slider(int slider_ypos, int max_val, int current_val) void draw_slider(int slider_ypos, int max_val, int current_val)
{ {
@ -181,18 +205,18 @@ void draw_slider(int slider_ypos, int max_val, int current_val)
int get_start_time(int play_time, int in_file) int get_start_time(int play_time, int in_file)
{ {
int quit = 0; int seek_quit = 0;
int button = 0; int button = 0;
int resume_time = settings.resume_time; int resume_time = settings.resume_time;
int slider_ypos = LCD_HEIGHT-45; int slider_ypos = LCD_HEIGHT-45;
int seek_rtn; int seek_return;
slider_state = state0; slider_state = state0;
thumbDelayTimer = *(rb->current_tick); thumbDelayTimer = *(rb->current_tick);
rb->lcd_clear_display(); rb->lcd_clear_display();
rb->lcd_update(); rb->lcd_update();
while(quit == 0) while(seek_quit == 0)
{ {
button = rb->button_get(false); button = rb->button_get(false);
switch (button) switch (button)
@ -200,172 +224,168 @@ int get_start_time(int play_time, int in_file)
#if (CONFIG_KEYPAD == GIGABEAT_PAD) || \ #if (CONFIG_KEYPAD == GIGABEAT_PAD) || \
(CONFIG_KEYPAD == SANSA_E200_PAD) || \ (CONFIG_KEYPAD == SANSA_E200_PAD) || \
(CONFIG_KEYPAD == SANSA_C200_PAD) (CONFIG_KEYPAD == SANSA_C200_PAD)
case MPEG_DOWN: case MPEG_DOWN:
case MPEG_DOWN | BUTTON_REPEAT: case MPEG_DOWN | BUTTON_REPEAT:
if ((resume_time -= 20) < 0) if ((resume_time -= 20) < 0)
resume_time = 0; resume_time = 0;
slider_state = state0; slider_state = state0;
thumbDelayTimer = *(rb->current_tick); thumbDelayTimer = *(rb->current_tick);
break; break;
case MPEG_UP: case MPEG_UP:
case MPEG_UP | BUTTON_REPEAT: case MPEG_UP | BUTTON_REPEAT:
if ((resume_time += 20) > play_time) if ((resume_time += 20) > play_time)
resume_time = play_time; resume_time = play_time;
slider_state = state0; slider_state = state0;
thumbDelayTimer = *(rb->current_tick); thumbDelayTimer = *(rb->current_tick);
break; break;
#endif #endif
case MPEG_LEFT: case MPEG_LEFT:
case MPEG_LEFT | BUTTON_REPEAT: case MPEG_LEFT | BUTTON_REPEAT:
case MPEG_SCROLL_UP: case MPEG_SCROLL_UP:
case MPEG_SCROLL_UP | BUTTON_REPEAT: case MPEG_SCROLL_UP | BUTTON_REPEAT:
if (--resume_time < 0) if (--resume_time < 0)
resume_time = 0; resume_time = 0;
slider_state = state0; slider_state = state0;
thumbDelayTimer = *(rb->current_tick); thumbDelayTimer = *(rb->current_tick);
break; break;
case MPEG_RIGHT: case MPEG_RIGHT:
case MPEG_RIGHT | BUTTON_REPEAT: case MPEG_RIGHT | BUTTON_REPEAT:
case MPEG_SCROLL_DOWN: case MPEG_SCROLL_DOWN:
case MPEG_SCROLL_DOWN | BUTTON_REPEAT: case MPEG_SCROLL_DOWN | BUTTON_REPEAT:
if (++resume_time > play_time) if (++resume_time > play_time)
resume_time = play_time; resume_time = play_time;
slider_state = state0; slider_state = state0;
thumbDelayTimer = *(rb->current_tick); thumbDelayTimer = *(rb->current_tick);
break; break;
case MPEG_SELECT: case MPEG_SELECT:
quit = 1; settings.resume_time = resume_time;
break; case MPEG_EXIT:
case MPEG_EXIT: seek_quit = 1;
resume_time = -1; break;
quit = 1; default:
break; if (rb->default_event_handler(button) == SYS_USB_CONNECTED)
default: seek_quit = 1;
if (rb->default_event_handler(button) == SYS_USB_CONNECTED) break;
{
resume_time = -1;
quit = 1;
}
break;
} }
rb->yield(); rb->yield();
switch(slider_state) switch(slider_state)
{ {
case state0: case state0:
rb->lcd_clear_display(); rb->lcd_clear_display();
rb->lcd_update(); rb->lcd_update();
#ifdef HAVE_LCD_COLOR #ifdef HAVE_LCD_COLOR
if (resume_time > 0) if (resume_time > 0)
rb->splash(0, "Loading..."); rb->splash(0, "Loading...");
#endif #endif
slider_state = state1; slider_state = state1;
break; break;
case state1: case state1:
if (*(rb->current_tick) - thumbDelayTimer > 75) if (*(rb->current_tick) - thumbDelayTimer > 75)
slider_state = state2; slider_state = state2;
if (resume_time == 0) if (resume_time == 0)
{ {
seek_rtn = 0; seek_return = 0;
slider_state = state5; slider_state = state5;
} }
draw_slider(slider_ypos, play_time, resume_time); draw_slider(slider_ypos, play_time, resume_time);
break; break;
case state2: case state2:
if ( (seek_rtn = seek_PTS(in_file, resume_time, 1)) >= 0) if ( (seek_return = seek_PTS(in_file, resume_time, 1)) >= 0)
slider_state = state3; slider_state = state3;
else if (seek_rtn == -101) else if (seek_return == -101)
{ {
slider_state = state0; slider_state = state0;
thumbDelayTimer = *(rb->current_tick); thumbDelayTimer = *(rb->current_tick);
} }
else else
slider_state = state4;
break;
case state3:
display_thumb(in_file);
draw_slider(slider_ypos, play_time, resume_time);
slider_state = state4; slider_state = state4;
break; break;
case state3: case state4:
display_thumb(in_file); draw_slider(slider_ypos, play_time, resume_time);
draw_slider(slider_ypos, play_time, resume_time); slider_state = state5;
slider_state = state4; break;
break; case state5:
case state4: break;
draw_slider(slider_ypos, play_time, resume_time);
slider_state = state5;
break;
case state5:
break;
} }
} }
return resume_time; return button;
} }
int mpeg_start_menu(int play_time, int in_file) enum mpeg_start_id mpeg_start_menu(int play_time, int in_file)
{ {
int m; int menu_id;
int result = 0; int result = 0;
int menu_quit = 0; int menu_quit = 0;
/* add the resume time to the menu display */ /* add the resume time to the menu display */
char resume_str[32]; char resume_str[32];
int time_hol = (int)(settings.resume_time/2); int time_hol = (int)(settings.resume_time/2);
int time_rem = ((settings.resume_time%2)==0) ? 0 : 5; int time_rem = ((settings.resume_time%2)==0) ? 0 : 5;
rb->snprintf(resume_str, sizeof(resume_str), rb->snprintf(resume_str, sizeof(resume_str),
"Resume time (min): %d.%d", time_hol, time_rem); "Resume time (min): %d.%d", time_hol, time_rem);
struct menu_item items[] = { struct menu_item items[] =
{ "Play from beginning", NULL }, {
{ resume_str, NULL }, [MPEG_START_RESTART] =
{ "Set start time (min)", NULL }, { "Play from beginning", NULL },
{ "Quit mpegplayer", NULL }, [MPEG_START_RESUME] =
{ resume_str, NULL },
[MPEG_START_SEEK] =
{ "Set start time (min)", NULL },
[MPEG_START_QUIT] =
{ "Quit mpegplayer", NULL },
}; };
m = menu_init(rb, items, sizeof(items) / sizeof(*items),
NULL, NULL, NULL, NULL); menu_id = menu_init(rb, items, sizeof(items) / sizeof(*items),
NULL, NULL, NULL, NULL);
rb->button_clear_queue(); rb->button_clear_queue();
while(menu_quit == 0) while(menu_quit == 0)
{ {
result = menu_show(m); result = menu_show(menu_id);
switch (result) switch (result)
{ {
case 0: case MPEG_START_RESTART:
menu_quit = 1; settings.resume_time = 0;
result = 0;
break;
case 1:
menu_quit = 1;
result = settings.resume_time;
break;
case 2:
#ifndef HAVE_LCD_COLOR
gray_show(true);
#endif
if ((result = get_start_time(play_time, in_file)) >= 0)
menu_quit = 1; menu_quit = 1;
#ifndef HAVE_LCD_COLOR break;
gray_show(false); case MPEG_START_RESUME:
#endif
break;
case 3:
menu_quit = 1;
result = -1;
break;
default:
if (result == MENU_ATTACHED_USB)
{
menu_quit = 1; menu_quit = 1;
result = -1; break;
} case MPEG_START_SEEK:
break; #ifndef HAVE_LCD_COLOR
gray_show(true);
#endif
if (get_start_time(play_time, in_file) == MPEG_SELECT)
menu_quit = 1;
#ifndef HAVE_LCD_COLOR
gray_show(false);
#endif
break;
case MPEG_START_QUIT:
menu_quit = 1;
break;
default:
result = MPEG_START_QUIT;
menu_quit = 1;
break;
} }
} }
menu_exit(m);
settings.resume_time = result; menu_exit(menu_id);
return (int)result;
return result;
} }
void clear_resume_count(void) void clear_resume_count(void)
@ -380,9 +400,9 @@ void clear_resume_count(void)
configfile_update_entry(SETTINGS_FILENAME, "Resume count", 0); configfile_update_entry(SETTINGS_FILENAME, "Resume count", 0);
} }
bool mpeg_menu(void) enum mpeg_menu_id mpeg_menu(void)
{ {
int m; int menu_id;
int result; int result;
int menu_quit=0; int menu_quit=0;
@ -392,68 +412,48 @@ bool mpeg_menu(void)
"Clear all resumes: %u", settings.resume_count); "Clear all resumes: %u", settings.resume_count);
struct menu_item items[] = { struct menu_item items[] = {
#if defined(TOSHIBA_GIGABEAT_F) || defined(SANSA_E200) [MPEG_MENU_DISPLAY_SETTINGS] =
[MPEG_OPTION_DISPLAY_SETTINGS] =
{ "Display Options", NULL }, { "Display Options", NULL },
#endif [MPEG_MENU_CLEAR_RESUMES] =
[MPEG_OPTION_DISPLAY_FPS] =
{ "Display FPS", NULL },
[MPEG_OPTION_LIMIT_FPS] =
{ "Limit FPS", NULL },
[MPEG_OPTION_SKIP_FRAMES] =
{ "Skip frames", NULL },
[MPEG_OPTION_CLEAR_RESUMES] =
{ clear_str, NULL }, { clear_str, NULL },
[MPEG_OPTION_QUIT] = [MPEG_MENU_QUIT] =
{ "Quit mpegplayer", NULL }, { "Quit mpegplayer", NULL },
}; };
m = menu_init(rb, items, ARRAYLEN(items), NULL, NULL, NULL, NULL); menu_id = menu_init(rb, items, ARRAYLEN(items),
NULL, NULL, NULL, NULL);
rb->button_clear_queue(); rb->button_clear_queue();
while (!menu_quit) { while (menu_quit == 0)
result=menu_show(m); {
result=menu_show(menu_id);
switch(result) switch(result)
{ {
#if defined(TOSHIBA_GIGABEAT_F) || defined(SANSA_E200) case MPEG_MENU_DISPLAY_SETTINGS:
case MPEG_OPTION_DISPLAY_SETTINGS:
display_options(); display_options();
break; break;
#endif case MPEG_MENU_CLEAR_RESUMES:
case MPEG_OPTION_DISPLAY_FPS:
rb->set_option("Display FPS",&settings.showfps,INT,
noyes, 2, NULL);
break;
case MPEG_OPTION_LIMIT_FPS:
rb->set_option("Limit FPS",&settings.limitfps,INT,
noyes, 2, NULL);
break;
case MPEG_OPTION_SKIP_FRAMES:
rb->set_option("Skip frames",&settings.skipframes,INT,
noyes, 2, NULL);
break;
case MPEG_OPTION_CLEAR_RESUMES:
clear_resume_count(); clear_resume_count();
rb->snprintf(clear_str, sizeof(clear_str), rb->snprintf(clear_str, sizeof(clear_str),
"Clear all resumes: %u", 0); "Clear all resumes: %u", 0);
break; break;
case MPEG_OPTION_QUIT: case MPEG_MENU_QUIT:
default: default:
menu_quit=1; menu_quit=1;
if (result == MENU_ATTACHED_USB) if (result == MENU_ATTACHED_USB)
result = MPEG_OPTION_QUIT; result = MPEG_MENU_QUIT;
break; break;
} }
} }
menu_exit(m); menu_exit(menu_id);
rb->lcd_clear_display(); rb->lcd_clear_display();
rb->lcd_update(); rb->lcd_update();
return (result==MPEG_OPTION_QUIT); return result;
} }
void init_settings(const char* filename) void init_settings(const char* filename)
@ -469,15 +469,9 @@ void init_settings(const char* filename)
configfile_init(rb); configfile_init(rb);
/* If the config file don't contain resume count if (configfile_load(SETTINGS_FILENAME, config,
or the load fails, then rebuild the config file. sizeof(config)/sizeof(*config),
This eliminates the worry for older config files SETTINGS_MIN_VERSION) < 0)
having unused data. */
if (((settings.resume_count = configfile_get_value
(SETTINGS_FILENAME, "Resume count")) < 0) ||
(configfile_load(SETTINGS_FILENAME, config,
sizeof(config)/sizeof(*config),
SETTINGS_MIN_VERSION) < 0))
{ {
/* Generate a new config file with default values */ /* Generate a new config file with default values */
configfile_save(SETTINGS_FILENAME, config, configfile_save(SETTINGS_FILENAME, config,
@ -498,9 +492,7 @@ void init_settings(const char* filename)
if (settings.resume_count < 0) if (settings.resume_count < 0)
{ {
settings.resume_count = 0; settings.resume_count = 0;
configfile_update_entry(SETTINGS_FILENAME, "Resume count", 0);
/* add this place holder so the count is above resume entries */
configfile_update_entry(SETTINGS_FILENAME, "Resume count", 0);
} }
rb->strcpy(settings.resume_filename, filename); rb->strcpy(settings.resume_filename, filename);

View file

@ -1,6 +1,31 @@
#include "plugin.h" #include "plugin.h"
enum mpeg_option_id
{
#if defined(TOSHIBA_GIGABEAT_F) || defined(SANSA_E200)
MPEG_OPTION_DITHERING,
#endif
MPEG_OPTION_DISPLAY_FPS,
MPEG_OPTION_LIMIT_FPS,
MPEG_OPTION_SKIP_FRAMES,
};
enum mpeg_start_id
{
MPEG_START_RESTART,
MPEG_START_RESUME,
MPEG_START_SEEK,
MPEG_START_QUIT,
};
enum mpeg_menu_id
{
MPEG_MENU_DISPLAY_SETTINGS,
MPEG_MENU_CLEAR_RESUMES,
MPEG_MENU_QUIT,
};
struct mpeg_settings { struct mpeg_settings {
int showfps; /* flag to display fps */ int showfps; /* flag to display fps */
int limitfps; /* flag to limit fps */ int limitfps; /* flag to limit fps */
@ -8,7 +33,6 @@ struct mpeg_settings {
int resume_count; /* total # of resumes in config file */ int resume_count; /* total # of resumes in config file */
int resume_time; /* resume time for current mpeg (in half minutes) */ int resume_time; /* resume time for current mpeg (in half minutes) */
char resume_filename[128]; /* filename of current mpeg */ char resume_filename[128]; /* filename of current mpeg */
#if defined(TOSHIBA_GIGABEAT_F) || defined(SANSA_E200) #if defined(TOSHIBA_GIGABEAT_F) || defined(SANSA_E200)
int displayoptions; int displayoptions;
#endif #endif
@ -17,8 +41,8 @@ struct mpeg_settings {
extern struct mpeg_settings settings; extern struct mpeg_settings settings;
int get_start_time(int play_time, int in_file); int get_start_time(int play_time, int in_file);
int mpeg_start_menu(int play_time, int in_file); enum mpeg_start_id mpeg_start_menu(int play_time, int in_file);
bool mpeg_menu(void); enum mpeg_menu_id mpeg_menu(void);
void init_settings(const char* filename); void init_settings(const char* filename);
void save_settings(void); void save_settings(void);
void clear_resume_count(void); void clear_resume_count(void);

View file

@ -1042,7 +1042,7 @@ static inline int32_t clip_sample(int32_t sample)
static int button_loop(void) static int button_loop(void)
{ {
bool result; int result;
int vol, minvol, maxvol; int vol, minvol, maxvol;
int button; int button;
@ -1118,15 +1118,19 @@ static int button_loop(void)
/* The menu can change the font, so restore */ /* The menu can change the font, so restore */
rb->lcd_setfont(FONT_SYSFIXED); rb->lcd_setfont(FONT_SYSFIXED);
if (result) { switch (result)
settings.resume_time = (int)(get_stream_time()/CLOCK_RATE/ {
30-start_pts_time); case MPEG_MENU_QUIT:
str_send_msg(&video_str, STREAM_QUIT, 0); settings.resume_time = (int)(get_stream_time()/CLOCK_RATE/
audio_str.status = STREAM_STOPPED; 30-start_pts_time);
} else { str_send_msg(&video_str, STREAM_QUIT, 0);
audio_str.status = STREAM_PLAYING; audio_str.status = STREAM_STOPPED;
str_send_msg(&video_str, STREAM_PLAY, 0); break;
pcm_playback_play_pause(true); default:
audio_str.status = STREAM_PLAYING;
str_send_msg(&video_str, STREAM_PLAY, 0);
pcm_playback_play_pause(true);
break;
} }
break; break;
@ -2203,7 +2207,8 @@ ssize_t seek_PTS( int in_file, int start_time, int accept_button )
enum plugin_status plugin_start(struct plugin_api* api, void* parameter) enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
{ {
int status = PLUGIN_ERROR; /* assume failure */ int status = PLUGIN_ERROR; /* assume failure */
int start_time=-1; int result;
int start_time = -1;
void* audiobuf; void* audiobuf;
ssize_t audiosize; ssize_t audiosize;
int in_file; int in_file;
@ -2295,8 +2300,6 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
rb->lcd_set_foreground(LCD_WHITE); rb->lcd_set_foreground(LCD_WHITE);
rb->lcd_set_background(LCD_BLACK); rb->lcd_set_background(LCD_BLACK);
#endif #endif
rb->lcd_clear_display();
rb->lcd_update();
init_settings((char*)parameter); init_settings((char*)parameter);
@ -2312,10 +2315,21 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
find_end_pts( in_file ); find_end_pts( in_file );
/* start menu */ /* start menu */
start_time = mpeg_start_menu(end_pts_time-start_pts_time, in_file); rb->lcd_clear_display();
if ( start_time == -1 ) rb->lcd_update();
return 0; result = mpeg_start_menu(end_pts_time-start_pts_time, in_file);
else if ( start_time < 0 )
switch (result)
{
case MPEG_START_QUIT:
return 0;
default:
start_time = settings.resume_time;
break;
}
/* basic time checks */
if ( start_time < 0 )
start_time = 0; start_time = 0;
else if ( start_time > (end_pts_time-start_pts_time) ) else if ( start_time > (end_pts_time-start_pts_time) )
start_time = (end_pts_time-start_pts_time); start_time = (end_pts_time-start_pts_time);