summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/plugins/mpegplayer/mpeg_settings.c43
-rw-r--r--apps/plugins/mpegplayer/mpeg_settings.h2
-rw-r--r--apps/plugins/mpegplayer/mpegplayer.c1
-rw-r--r--apps/plugins/mpegplayer/video_out_rockbox.c18
4 files changed, 54 insertions, 10 deletions
diff --git a/apps/plugins/mpegplayer/mpeg_settings.c b/apps/plugins/mpegplayer/mpeg_settings.c
index 9e6fa57fb5..0a717aeaac 100644
--- a/apps/plugins/mpegplayer/mpeg_settings.c
+++ b/apps/plugins/mpegplayer/mpeg_settings.c
@@ -101,6 +101,8 @@ static struct configdata config[] =
101 {TYPE_INT, 0, 2, &settings.skipframes, "Skip frames", NULL, NULL}, 101 {TYPE_INT, 0, 2, &settings.skipframes, "Skip frames", NULL, NULL},
102 {TYPE_INT, 0, INT_MAX, &settings.resume_count, "Resume count", 102 {TYPE_INT, 0, INT_MAX, &settings.resume_count, "Resume count",
103 NULL, NULL}, 103 NULL, NULL},
104 {TYPE_INT, 0, 2, &settings.enable_start_menu, "Enable start menu",
105 NULL, NULL},
104#if defined(TOSHIBA_GIGABEAT_F) || defined(SANSA_E200) || defined(SANSA_C200) 106#if defined(TOSHIBA_GIGABEAT_F) || defined(SANSA_E200) || defined(SANSA_C200)
105 {TYPE_INT, 0, INT_MAX, &settings.displayoptions, "Display options", 107 {TYPE_INT, 0, INT_MAX, &settings.displayoptions, "Display options",
106 NULL, NULL}, 108 NULL, NULL},
@@ -112,6 +114,11 @@ static const struct opt_items noyes[2] = {
112 { "Yes", -1 }, 114 { "Yes", -1 },
113}; 115};
114 116
117static const struct opt_items enabledisable[2] = {
118 { "Disable", -1 },
119 { "Enable", -1 },
120};
121
115static void display_options(void) 122static void display_options(void)
116{ 123{
117 int result; 124 int result;
@@ -329,6 +336,32 @@ enum mpeg_start_id mpeg_start_menu(int play_time, int in_file)
329 char resume_str[32]; 336 char resume_str[32];
330 int time_hol = (int)(settings.resume_time/2); 337 int time_hol = (int)(settings.resume_time/2);
331 int time_rem = ((settings.resume_time%2)==0) ? 0 : 5; 338 int time_rem = ((settings.resume_time%2)==0) ? 0 : 5;
339
340 if (settings.enable_start_menu == 0)
341 {
342 rb->snprintf(resume_str, sizeof(resume_str),
343 "Yes (min): %d.%d", time_hol, time_rem);
344
345 struct opt_items resume_no_yes[2] =
346 {
347 { "No", -1 },
348 { resume_str, -1 },
349 };
350 if (settings.resume_time == 0)
351 return MPEG_START_RESTART;
352
353 rb->set_option("Resume", &result, INT,
354 resume_no_yes, 2, NULL);
355
356 if (result == 0)
357 {
358 settings.resume_time = 0;
359 return MPEG_START_RESTART;
360 }
361 else
362 return MPEG_START_RESUME;
363 }
364
332 rb->snprintf(resume_str, sizeof(resume_str), 365 rb->snprintf(resume_str, sizeof(resume_str),
333 "Resume time (min): %d.%d", time_hol, time_rem); 366 "Resume time (min): %d.%d", time_hol, time_rem);
334 367
@@ -414,6 +447,8 @@ enum mpeg_menu_id mpeg_menu(void)
414 struct menu_item items[] = { 447 struct menu_item items[] = {
415 [MPEG_MENU_DISPLAY_SETTINGS] = 448 [MPEG_MENU_DISPLAY_SETTINGS] =
416 { "Display Options", NULL }, 449 { "Display Options", NULL },
450 [MPEG_MENU_ENABLE_START_MENU] =
451 { "Start menu", NULL },
417 [MPEG_MENU_CLEAR_RESUMES] = 452 [MPEG_MENU_CLEAR_RESUMES] =
418 { clear_str, NULL }, 453 { clear_str, NULL },
419 [MPEG_MENU_QUIT] = 454 [MPEG_MENU_QUIT] =
@@ -434,6 +469,11 @@ enum mpeg_menu_id mpeg_menu(void)
434 case MPEG_MENU_DISPLAY_SETTINGS: 469 case MPEG_MENU_DISPLAY_SETTINGS:
435 display_options(); 470 display_options();
436 break; 471 break;
472 case MPEG_MENU_ENABLE_START_MENU:
473 rb->set_option("Start menu",
474 &settings.enable_start_menu,
475 INT, enabledisable, 2, NULL);
476 break;
437 case MPEG_MENU_CLEAR_RESUMES: 477 case MPEG_MENU_CLEAR_RESUMES:
438 clear_resume_count(); 478 clear_resume_count();
439 rb->snprintf(clear_str, sizeof(clear_str), 479 rb->snprintf(clear_str, sizeof(clear_str),
@@ -462,6 +502,7 @@ void init_settings(const char* filename)
462 settings.showfps = 0; /* Do not show FPS */ 502 settings.showfps = 0; /* Do not show FPS */
463 settings.limitfps = 1; /* Limit FPS */ 503 settings.limitfps = 1; /* Limit FPS */
464 settings.skipframes = 1; /* Skip frames */ 504 settings.skipframes = 1; /* Skip frames */
505 settings.enable_start_menu = 1; /* Enable start menu */
465 settings.resume_count = -1; 506 settings.resume_count = -1;
466#if defined(TOSHIBA_GIGABEAT_F) || defined(SANSA_E200) || defined(SANSA_C200) 507#if defined(TOSHIBA_GIGABEAT_F) || defined(SANSA_E200) || defined(SANSA_C200)
467 settings.displayoptions = 0; /* No visual effects */ 508 settings.displayoptions = 0; /* No visual effects */
@@ -513,6 +554,8 @@ void save_settings(void)
513 settings.limitfps); 554 settings.limitfps);
514 configfile_update_entry(SETTINGS_FILENAME, "Skip frames", 555 configfile_update_entry(SETTINGS_FILENAME, "Skip frames",
515 settings.skipframes); 556 settings.skipframes);
557 configfile_update_entry(SETTINGS_FILENAME, "Enable start menu",
558 settings.enable_start_menu);
516 559
517 /* If this was a new resume entry then update the total resume count */ 560 /* If this was a new resume entry then update the total resume count */
518 if (configfile_update_entry(SETTINGS_FILENAME, settings.resume_filename, 561 if (configfile_update_entry(SETTINGS_FILENAME, settings.resume_filename,
diff --git a/apps/plugins/mpegplayer/mpeg_settings.h b/apps/plugins/mpegplayer/mpeg_settings.h
index 37ceda7225..613a345307 100644
--- a/apps/plugins/mpegplayer/mpeg_settings.h
+++ b/apps/plugins/mpegplayer/mpeg_settings.h
@@ -22,6 +22,7 @@ enum mpeg_start_id
22enum mpeg_menu_id 22enum mpeg_menu_id
23{ 23{
24 MPEG_MENU_DISPLAY_SETTINGS, 24 MPEG_MENU_DISPLAY_SETTINGS,
25 MPEG_MENU_ENABLE_START_MENU,
25 MPEG_MENU_CLEAR_RESUMES, 26 MPEG_MENU_CLEAR_RESUMES,
26 MPEG_MENU_QUIT, 27 MPEG_MENU_QUIT,
27}; 28};
@@ -30,6 +31,7 @@ struct mpeg_settings {
30 int showfps; /* flag to display fps */ 31 int showfps; /* flag to display fps */
31 int limitfps; /* flag to limit fps */ 32 int limitfps; /* flag to limit fps */
32 int skipframes; /* flag to skip frames */ 33 int skipframes; /* flag to skip frames */
34 int enable_start_menu; /* flag to enable/disable start menu */
33 int resume_count; /* total # of resumes in config file */ 35 int resume_count; /* total # of resumes in config file */
34 int resume_time; /* resume time for current mpeg (in half minutes) */ 36 int resume_time; /* resume time for current mpeg (in half minutes) */
35 char resume_filename[128]; /* filename of current mpeg */ 37 char resume_filename[128]; /* filename of current mpeg */
diff --git a/apps/plugins/mpegplayer/mpegplayer.c b/apps/plugins/mpegplayer/mpegplayer.c
index 37ac1fa78c..e77031b76e 100644
--- a/apps/plugins/mpegplayer/mpegplayer.c
+++ b/apps/plugins/mpegplayer/mpegplayer.c
@@ -2402,7 +2402,6 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
2402 /* seek start time */ 2402 /* seek start time */
2403 seek_pos = seek_PTS( in_file, start_time, 0 ); 2403 seek_pos = seek_PTS( in_file, start_time, 0 );
2404 2404
2405 rb->lseek(in_file,seek_pos,SEEK_SET);
2406 video_thumb_print = 0; 2405 video_thumb_print = 0;
2407 audio_sync_start = 0; 2406 audio_sync_start = 0;
2408 audio_sync_time = 0; 2407 audio_sync_time = 0;
diff --git a/apps/plugins/mpegplayer/video_out_rockbox.c b/apps/plugins/mpegplayer/video_out_rockbox.c
index 490f04411f..9dd8d6a467 100644
--- a/apps/plugins/mpegplayer/video_out_rockbox.c
+++ b/apps/plugins/mpegplayer/video_out_rockbox.c
@@ -78,9 +78,9 @@ void vo_draw_frame_thumb (uint8_t * const * buf)
78 for (c=0;c<image_height/4;c++) 78 for (c=0;c<image_height/4;c++)
79 { 79 {
80 *(tmpbuf[1]+c*image_width/4+r) = 80 *(tmpbuf[1]+c*image_width/4+r) =
81 *(buf[1]+2*c*image_width/2+2*r); 81 *(buf[1]+c*image_width+2*r);
82 *(tmpbuf[2]+c*image_width/4+r) = 82 *(tmpbuf[2]+c*image_width/4+r) =
83 *(buf[2]+2*c*image_width/2+2*r); 83 *(buf[2]+c*image_width+2*r);
84 } 84 }
85#else 85#else
86 for (r=0;r<image_width/2;r++) 86 for (r=0;r<image_width/2;r++)
@@ -92,9 +92,9 @@ void vo_draw_frame_thumb (uint8_t * const * buf)
92 for (c=0;c<image_height/4;c++) 92 for (c=0;c<image_height/4;c++)
93 { 93 {
94 *(tmpbuf[1]+(image_width/4-1-r)*image_height/4+c) = 94 *(tmpbuf[1]+(image_width/4-1-r)*image_height/4+c) =
95 *(buf[1]+2*c*image_width/2+2*r); 95 *(buf[1]+c*image_width+2*r);
96 *(tmpbuf[2]+(image_width/4-1-r)*image_height/4+c) = 96 *(tmpbuf[2]+(image_width/4-1-r)*image_height/4+c) =
97 *(buf[2]+2*c*image_width/2+2*r); 97 *(buf[2]+c*image_width+2*r);
98 } 98 }
99#endif 99#endif
100 100
@@ -148,12 +148,12 @@ void vo_setup(const mpeg2_sequence_t * sequence)
148 image_width=sequence->width; 148 image_width=sequence->width;
149 image_height=sequence->height; 149 image_height=sequence->height;
150 150
151 tmpbufa = (uint8_t*)mpeg2_malloc(sizeof(uint8_t)*image_width/2* 151 tmpbufa = (uint8_t*)mpeg2_malloc(sizeof(uint8_t)*image_width*
152 image_height/2, -2);
153 tmpbufb = (uint8_t*)mpeg2_malloc(sizeof(uint8_t)*image_width/4*
154 image_height/4, -2);
155 tmpbufc = (uint8_t*)mpeg2_malloc(sizeof(uint8_t)*image_width/4*
156 image_height/4, -2); 152 image_height/4, -2);
153 tmpbufb = (uint8_t*)mpeg2_malloc(sizeof(uint8_t)*image_width*
154 image_height/16, -2);
155 tmpbufc = (uint8_t*)mpeg2_malloc(sizeof(uint8_t)*image_width*
156 image_height/16, -2);
157 tmpbuf[0] = tmpbufa; 157 tmpbuf[0] = tmpbufa;
158 tmpbuf[1] = tmpbufb; 158 tmpbuf[1] = tmpbufb;
159 tmpbuf[2] = tmpbufc; 159 tmpbuf[2] = tmpbufc;