comparison mplayer.c @ 16929:7a760501d6cd

Number of frames to show the OSD shouldn't be hardcoded, derive from fps instead
author ranma
date Sun, 06 Nov 2005 14:44:49 +0000
parents f5e079f84466
children ef03a74ca7af
comparison
equal deleted inserted replaced
16928:9d2fe3b315ec 16929:7a760501d6cd
2857 while( !brk_cmd && (cmd = mp_input_get_cmd(0,0,0)) != NULL) { 2857 while( !brk_cmd && (cmd = mp_input_get_cmd(0,0,0)) != NULL) {
2858 switch(cmd->id) { 2858 switch(cmd->id) {
2859 case MP_CMD_SEEK : { 2859 case MP_CMD_SEEK : {
2860 float v; 2860 float v;
2861 int abs; 2861 int abs;
2862 osd_show_percentage = 25; 2862 osd_show_percentage = sh_video->fps;
2863 v = cmd->args[0].v.f; 2863 v = cmd->args[0].v.f;
2864 abs = (cmd->nargs > 1) ? cmd->args[1].v.i : 0; 2864 abs = (cmd->nargs > 1) ? cmd->args[1].v.i : 0;
2865 if(abs==2) { /* Absolute seek to a specific timestamp in seconds */ 2865 if(abs==2) { /* Absolute seek to a specific timestamp in seconds */
2866 abs_seek_pos = 1; 2866 abs_seek_pos = 1;
2867 if(sh_video) 2867 if(sh_video)
2896 mpcodecs_config_vo (sh_video, sh_video->disp_w, sh_video->disp_h, 0); 2896 mpcodecs_config_vo (sh_video, sh_video->disp_w, sh_video->disp_h, 0);
2897 } break; 2897 } break;
2898 case MP_CMD_AUDIO_DELAY : { 2898 case MP_CMD_AUDIO_DELAY : {
2899 float v = cmd->args[0].v.f; 2899 float v = cmd->args[0].v.f;
2900 audio_delay += v; 2900 audio_delay += v;
2901 osd_show_av_delay = 9; 2901 osd_show_av_delay = sh_video->fps/2;
2902 if(sh_audio) sh_audio->delay+= v; 2902 if(sh_audio) sh_audio->delay+= v;
2903 } break; 2903 } break;
2904 case MP_CMD_SPEED_INCR : { 2904 case MP_CMD_SPEED_INCR : {
2905 float v = cmd->args[0].v.f; 2905 float v = cmd->args[0].v.f;
2906 playback_speed += v; 2906 playback_speed += v;
2992 float v = cmd->args[0].v.f; 2992 float v = cmd->args[0].v.f;
2993 if(abs) 2993 if(abs)
2994 sub_delay = v; 2994 sub_delay = v;
2995 else 2995 else
2996 sub_delay += v; 2996 sub_delay += v;
2997 osd_show_sub_delay = 9; // show the subdelay in OSD 2997 osd_show_sub_delay = sh_video->fps/2; // show the subdelay in OSD
2998 } 2998 }
2999 #endif 2999 #endif
3000 } break; 3000 } break;
3001 case MP_CMD_SUB_STEP : { 3001 case MP_CMD_SUB_STEP : {
3002 #ifdef USE_SUB 3002 #ifdef USE_SUB
3003 if (sh_video) { 3003 if (sh_video) {
3004 int movement = cmd->args[0].v.i; 3004 int movement = cmd->args[0].v.i;
3005 step_sub(subdata, sh_video->pts, movement); 3005 step_sub(subdata, sh_video->pts, movement);
3006 osd_show_sub_delay = 9; // show the subdelay in OSD 3006 osd_show_sub_delay = sh_video->fps/2; // show the subdelay in OSD
3007 } 3007 }
3008 #endif 3008 #endif
3009 } break; 3009 } break;
3010 case MP_CMD_SUB_LOG : { 3010 case MP_CMD_SUB_LOG : {
3011 #ifdef USE_SUB 3011 #ifdef USE_SUB
3021 else 3021 else
3022 osd_level= v > MAX_OSD_LEVEL ? MAX_OSD_LEVEL : v; 3022 osd_level= v > MAX_OSD_LEVEL ? MAX_OSD_LEVEL : v;
3023 /* Show OSD state when disabled, but not when an explicit 3023 /* Show OSD state when disabled, but not when an explicit
3024 argument is given to the osd command, i.e. in slave mode. */ 3024 argument is given to the osd command, i.e. in slave mode. */
3025 if (v == -1 && osd_level <= 1) 3025 if (v == -1 && osd_level <= 1)
3026 osd_show_status = 9; 3026 osd_show_status = sh_video->fps/2;
3027 } 3027 }
3028 #endif 3028 #endif
3029 } break; 3029 } break;
3030 case MP_CMD_OSD_SHOW_TEXT : { 3030 case MP_CMD_OSD_SHOW_TEXT : {
3031 #ifdef USE_OSD 3031 #ifdef USE_OSD
3272 case MP_CMD_FRAMEDROPPING : { 3272 case MP_CMD_FRAMEDROPPING : {
3273 int v = cmd->args[0].v.i; 3273 int v = cmd->args[0].v.i;
3274 if(v < 0){ 3274 if(v < 0){
3275 frame_dropping = (frame_dropping+1)%3; 3275 frame_dropping = (frame_dropping+1)%3;
3276 #ifdef USE_OSD 3276 #ifdef USE_OSD
3277 osd_show_framedropping=10; 3277 osd_show_framedropping=sh_video->fps/2;
3278 vo_osd_changed(OSDTYPE_SUBTITLE); 3278 vo_osd_changed(OSDTYPE_SUBTITLE);
3279 #endif 3279 #endif
3280 } 3280 }
3281 else 3281 else
3282 frame_dropping = v > 2 ? 2 : v; 3282 frame_dropping = v > 2 ? 2 : v;
3422 case MP_CMD_VO_ONTOP: 3422 case MP_CMD_VO_ONTOP:
3423 { 3423 {
3424 if(video_out && vo_config_count) { 3424 if(video_out && vo_config_count) {
3425 video_out->control(VOCTRL_ONTOP, 0); 3425 video_out->control(VOCTRL_ONTOP, 0);
3426 #ifdef USE_OSD 3426 #ifdef USE_OSD
3427 osd_show_ontop=10; 3427 osd_show_ontop=sh_video->fps/2;
3428 vo_osd_changed(OSDTYPE_SUBTITLE); 3428 vo_osd_changed(OSDTYPE_SUBTITLE);
3429 #endif 3429 #endif
3430 } 3430 }
3431 3431
3432 } break; 3432 } break;
3433 case MP_CMD_VO_ROOTWIN: 3433 case MP_CMD_VO_ROOTWIN:
3434 { 3434 {
3435 if(video_out && vo_config_count) { 3435 if(video_out && vo_config_count) {
3436 video_out->control(VOCTRL_ROOTWIN, 0); 3436 video_out->control(VOCTRL_ROOTWIN, 0);
3437 #ifdef USE_OSD 3437 #ifdef USE_OSD
3438 osd_show_rootwin=10; 3438 osd_show_rootwin=sh_video->fps/2;
3439 vo_osd_changed(OSDTYPE_SUBTITLE); 3439 vo_osd_changed(OSDTYPE_SUBTITLE);
3440 #endif 3440 #endif
3441 } 3441 }
3442 3442
3443 } break; 3443 } break;
3471 3471
3472 sub_pos+=v; 3472 sub_pos+=v;
3473 if(sub_pos >100) sub_pos=100; 3473 if(sub_pos >100) sub_pos=100;
3474 if(sub_pos <0) sub_pos=0; 3474 if(sub_pos <0) sub_pos=0;
3475 vo_osd_changed(OSDTYPE_SUBTITLE); 3475 vo_osd_changed(OSDTYPE_SUBTITLE);
3476 osd_show_sub_pos = 9; 3476 osd_show_sub_pos = sh_video->fps/2;
3477 } 3477 }
3478 #endif 3478 #endif
3479 } break; 3479 } break;
3480 case MP_CMD_SUB_ALIGNMENT: 3480 case MP_CMD_SUB_ALIGNMENT:
3481 { 3481 {
3483 if (sh_video) { 3483 if (sh_video) {
3484 if (cmd->nargs >= 1) 3484 if (cmd->nargs >= 1)
3485 sub_alignment = cmd->args[0].v.i; 3485 sub_alignment = cmd->args[0].v.i;
3486 else 3486 else
3487 sub_alignment = (sub_alignment+1) % 3; 3487 sub_alignment = (sub_alignment+1) % 3;
3488 osd_show_sub_alignment = 9; 3488 osd_show_sub_alignment = sh_video->fps/2;
3489 vo_osd_changed(OSDTYPE_SUBTITLE); 3489 vo_osd_changed(OSDTYPE_SUBTITLE);
3490 } 3490 }
3491 #endif 3491 #endif
3492 } break; 3492 } break;
3493 case MP_CMD_SUB_VISIBILITY: 3493 case MP_CMD_SUB_VISIBILITY:
3494 { 3494 {
3495 #ifdef USE_SUB 3495 #ifdef USE_SUB
3496 if (sh_video) { 3496 if (sh_video) {
3497 sub_visibility=1-sub_visibility; 3497 sub_visibility=1-sub_visibility;
3498 osd_show_sub_visibility = 9; // show state of subtitle visibility in OSD 3498 osd_show_sub_visibility = sh_video->fps/2; // show state of subtitle visibility in OSD
3499 vo_osd_changed(OSDTYPE_SUBTITLE); 3499 vo_osd_changed(OSDTYPE_SUBTITLE);
3500 } 3500 }
3501 #endif 3501 #endif
3502 } break; 3502 } break;
3503 case MP_CMD_SUB_LOAD: 3503 case MP_CMD_SUB_LOAD:
3761 hevent->ex,hevent->ey, 3761 hevent->ex,hevent->ey,
3762 hevent->pts, d_video->pts); 3762 hevent->pts, d_video->pts);
3763 mp_msg(MSGT_FIXME, MSGL_FIXME, MSGTR_DvdnavEvent,dvd_nav_text); 3763 mp_msg(MSGT_FIXME, MSGL_FIXME, MSGTR_DvdnavEvent,dvd_nav_text);
3764 //osd_show_dvd_nav_delay = 60; 3764 //osd_show_dvd_nav_delay = 60;
3765 3765
3766 osd_show_dvd_nav_highlight=1; 3766 osd_show_dvd_nav_highlight=sh_video->fps/2;
3767 osd_show_dvd_nav_sx=hevent->sx; 3767 osd_show_dvd_nav_sx=hevent->sx;
3768 osd_show_dvd_nav_ex=hevent->ex; 3768 osd_show_dvd_nav_ex=hevent->ex;
3769 osd_show_dvd_nav_sy=hevent->sy; 3769 osd_show_dvd_nav_sy=hevent->sy;
3770 osd_show_dvd_nav_ey=hevent->ey; 3770 osd_show_dvd_nav_ey=hevent->ey;
3771 } 3771 }