Mercurial > mplayer.hg
comparison mplayer.c @ 5511:7a24a067f0af
vo_config_count now counts calls to vo->config()
author | arpi |
---|---|
date | Sun, 07 Apr 2002 02:12:15 +0000 |
parents | d0d029fda134 |
children | 25c43bd75e4c |
comparison
equal
deleted
inserted
replaced
5510:f2c4cace6450 | 5511:7a24a067f0af |
---|---|
308 } | 308 } |
309 | 309 |
310 if(mask&INITED_VO){ | 310 if(mask&INITED_VO){ |
311 inited_flags&=~INITED_VO; | 311 inited_flags&=~INITED_VO; |
312 current_module="uninit_vo"; | 312 current_module="uninit_vo"; |
313 video_out->uninit(); video_out=NULL; | 313 video_out->uninit(); |
314 video_out=NULL; | |
314 } | 315 } |
315 | 316 |
316 if(mask&INITED_AO){ | 317 if(mask&INITED_AO){ |
317 inited_flags&=~INITED_AO; | 318 inited_flags&=~INITED_AO; |
318 current_module="uninit_ao"; | 319 current_module="uninit_ao"; |
1208 if(!sh_video) | 1209 if(!sh_video) |
1209 goto main; | 1210 goto main; |
1210 | 1211 |
1211 current_module="preinit_libvo"; | 1212 current_module="preinit_libvo"; |
1212 | 1213 |
1214 vo_config_count=0; | |
1213 if((video_out->preinit(vo_subdevice))!=0){ | 1215 if((video_out->preinit(vo_subdevice))!=0){ |
1214 mp_msg(MSGT_CPLAYER,MSGL_FATAL,"Error opening/initializing the selected video_out (-vo) device!\n"); | 1216 mp_msg(MSGT_CPLAYER,MSGL_FATAL,"Error opening/initializing the selected video_out (-vo) device!\n"); |
1215 goto goto_next_file; // exit_player(MSGTR_Exit_error); | 1217 goto goto_next_file; // exit_player(MSGTR_Exit_error); |
1216 } | 1218 } |
1217 sh_video->video_out=video_out; | 1219 sh_video->video_out=video_out; |
1536 vdecode_time=video_time_usage-vdecode_time; | 1538 vdecode_time=video_time_usage-vdecode_time; |
1537 //------------------------ frame decoded. -------------------- | 1539 //------------------------ frame decoded. -------------------- |
1538 | 1540 |
1539 //------------------------ add OSD to frame contents --------- | 1541 //------------------------ add OSD to frame contents --------- |
1540 current_module="draw_osd"; | 1542 current_module="draw_osd"; |
1541 video_out->draw_osd(); | 1543 if(vo_config_count) video_out->draw_osd(); |
1542 | 1544 |
1543 current_module="av_sync"; | 1545 current_module="av_sync"; |
1544 | 1546 |
1545 sh_video->timer+=frame_time; | 1547 sh_video->timer+=frame_time; |
1546 time_frame+=frame_time; // for nosound | 1548 time_frame+=frame_time; // for nosound |
1564 } | 1566 } |
1565 } | 1567 } |
1566 #ifdef HAVE_NEW_GUI | 1568 #ifdef HAVE_NEW_GUI |
1567 if(use_gui) guiEventHandling(); | 1569 if(use_gui) guiEventHandling(); |
1568 #endif | 1570 #endif |
1569 video_out->check_events(); // check events AST | 1571 if(vo_config_count) video_out->check_events(); // check events AST |
1570 } else { | 1572 } else { |
1571 // It's time to sleep... | 1573 // It's time to sleep... |
1572 current_module="sleep"; | 1574 current_module="sleep"; |
1573 | 1575 |
1574 time_frame-=GetRelativeTime(); // reset timer | 1576 time_frame-=GetRelativeTime(); // reset timer |
1686 } | 1688 } |
1687 | 1689 |
1688 } | 1690 } |
1689 | 1691 |
1690 current_module="flip_page"; | 1692 current_module="flip_page"; |
1691 video_out->check_events(); | 1693 if(vo_config_count) video_out->check_events(); |
1692 if(blit_frame){ | 1694 if(blit_frame){ |
1693 unsigned int t2=GetTimer(); | 1695 unsigned int t2=GetTimer(); |
1694 double tt; | 1696 double tt; |
1695 float j; | 1697 float j; |
1696 #define FRAME_LAG_WARN 0.2 | 1698 #define FRAME_LAG_WARN 0.2 |
1701 /* printf ("PANIC: too fast frame (%.3f)!\n", j); */ | 1703 /* printf ("PANIC: too fast frame (%.3f)!\n", j); */ |
1702 else if (j > frame_time + frame_time * FRAME_LAG_WARN) | 1704 else if (j > frame_time + frame_time * FRAME_LAG_WARN) |
1703 too_slow_frame_cnt++; | 1705 too_slow_frame_cnt++; |
1704 /* printf ("PANIC: too slow frame (%.3f)!\n", j); */ | 1706 /* printf ("PANIC: too slow frame (%.3f)!\n", j); */ |
1705 | 1707 |
1706 video_out->flip_page(); | 1708 if(vo_config_count) video_out->flip_page(); |
1707 t2=GetTimer()-t2; | 1709 t2=GetTimer()-t2; |
1708 tt = t2*0.000001f; | 1710 tt = t2*0.000001f; |
1709 vout_time_usage+=tt; | 1711 vout_time_usage+=tt; |
1710 } | 1712 } |
1711 // usec_sleep(50000); // test only! | 1713 // usec_sleep(50000); // test only! |
1863 fflush(stdout); | 1865 fflush(stdout); |
1864 } | 1866 } |
1865 #ifdef HAVE_NEW_GUI | 1867 #ifdef HAVE_NEW_GUI |
1866 if(use_gui) guiGetEvent( guiCEvent,(char *)guiSetPause ); | 1868 if(use_gui) guiGetEvent( guiCEvent,(char *)guiSetPause ); |
1867 #endif | 1869 #endif |
1868 if (video_out && sh_video) | 1870 if (video_out && sh_video && vo_config_count) |
1869 video_out->control(VOCTRL_PAUSE, NULL); | 1871 video_out->control(VOCTRL_PAUSE, NULL); |
1870 | 1872 |
1871 if (audio_out && sh_audio) | 1873 if (audio_out && sh_audio) |
1872 audio_out->pause(); // pause audio, keep data if possible | 1874 audio_out->pause(); // pause audio, keep data if possible |
1873 | 1875 |
1893 #ifdef HAVE_LIRC | 1895 #ifdef HAVE_LIRC |
1894 lirc_mp_getinput()<=0 && | 1896 lirc_mp_getinput()<=0 && |
1895 #endif | 1897 #endif |
1896 (use_stdin || getch2(20)<=0) && mplayer_get_key()<=0){ | 1898 (use_stdin || getch2(20)<=0) && mplayer_get_key()<=0){ |
1897 #endif /* HAVE_NEW_INPUT */ | 1899 #endif /* HAVE_NEW_INPUT */ |
1898 if(sh_video && video_out) video_out->check_events(); | 1900 if(sh_video && video_out && vo_config_count) video_out->check_events(); |
1899 #ifdef HAVE_NEW_GUI | 1901 #ifdef HAVE_NEW_GUI |
1900 if(use_gui){ | 1902 if(use_gui){ |
1901 guiEventHandling(); | 1903 guiEventHandling(); |
1902 if(guiIntfStruct.Playing!=2 || (rel_seek_secs || abs_seek_pos)) break; | 1904 if(guiIntfStruct.Playing!=2 || (rel_seek_secs || abs_seek_pos)) break; |
1903 } | 1905 } |
1912 } | 1914 } |
1913 #endif /* HAVE_NEW_INPUT */ | 1915 #endif /* HAVE_NEW_INPUT */ |
1914 osd_function=OSD_PLAY; | 1916 osd_function=OSD_PLAY; |
1915 if (audio_out && sh_audio) | 1917 if (audio_out && sh_audio) |
1916 audio_out->resume(); // resume audio | 1918 audio_out->resume(); // resume audio |
1917 if (video_out && sh_video) | 1919 if (video_out && sh_video && vo_config_count) |
1918 video_out->control(VOCTRL_RESUME, NULL); // resume video | 1920 video_out->control(VOCTRL_RESUME, NULL); // resume video |
1919 (void)GetRelativeTime(); // keep TF around FT in next cycle | 1921 (void)GetRelativeTime(); // keep TF around FT in next cycle |
1920 #ifdef HAVE_NEW_GUI | 1922 #ifdef HAVE_NEW_GUI |
1921 if (use_gui) guiGetEvent( guiCEvent,(char *)guiSetPlay ); | 1923 if (use_gui) guiGetEvent( guiCEvent,(char *)guiSetPlay ); |
1922 #endif | 1924 #endif |
2111 break; | 2113 break; |
2112 #else | 2114 #else |
2113 /* User wants to have screen shot */ | 2115 /* User wants to have screen shot */ |
2114 case 'S': | 2116 case 'S': |
2115 case 's': | 2117 case 's': |
2116 video_out->control(VOCTRL_SCREENSHOT, NULL); | 2118 if(vo_config_count) video_out->control(VOCTRL_SCREENSHOT, NULL); |
2117 break; | 2119 break; |
2118 // Contrast: | 2120 // Contrast: |
2119 case '1': | 2121 case '1': |
2120 case '2': | 2122 case '2': |
2121 if(c=='2'){ | 2123 if(c=='2'){ |
2251 tv_step_chanlist(tv_handler); | 2253 tv_step_chanlist(tv_handler); |
2252 break; | 2254 break; |
2253 #endif | 2255 #endif |
2254 | 2256 |
2255 case 'f': | 2257 case 'f': |
2256 video_out->control(VOCTRL_FULLSCREEN, 0); | 2258 if(vo_config_count) video_out->control(VOCTRL_FULLSCREEN, 0); |
2257 break; | 2259 break; |
2258 } | 2260 } |
2259 } // keyboard event handler | 2261 } // keyboard event handler |
2260 | 2262 |
2261 #else /* HAVE_NEW_INPUT */ | 2263 #else /* HAVE_NEW_INPUT */ |
2474 { | 2476 { |
2475 #ifdef HAVE_NEW_GUI | 2477 #ifdef HAVE_NEW_GUI |
2476 if ( use_gui ) guiGetEvent( guiIEvent,(char *)MP_CMD_GUI_FULLSCREEN ); | 2478 if ( use_gui ) guiGetEvent( guiIEvent,(char *)MP_CMD_GUI_FULLSCREEN ); |
2477 else | 2479 else |
2478 #endif | 2480 #endif |
2479 if(video_out) video_out->control(VOCTRL_FULLSCREEN, 0); | 2481 if(video_out && vo_config_count) video_out->control(VOCTRL_FULLSCREEN, 0); |
2480 } break; | 2482 } break; |
2481 case MP_CMD_SUB_POS: | 2483 case MP_CMD_SUB_POS: |
2482 { | 2484 { |
2483 int v; | 2485 int v; |
2484 v = cmd->args[0].v.i; | 2486 v = cmd->args[0].v.i; |
2730 } | 2732 } |
2731 fflush(stdout); | 2733 fflush(stdout); |
2732 | 2734 |
2733 if(sh_video){ | 2735 if(sh_video){ |
2734 current_module="seek_video_reset"; | 2736 current_module="seek_video_reset"; |
2735 video_out->control(VOCTRL_RESET,NULL); | 2737 if(vo_config_count) video_out->control(VOCTRL_RESET,NULL); |
2736 } | 2738 } |
2737 | 2739 |
2738 if(sh_audio){ | 2740 if(sh_audio){ |
2739 current_module="seek_audio_reset"; | 2741 current_module="seek_audio_reset"; |
2740 audio_out->reset(); // stop audio, throwing away buffered data | 2742 audio_out->reset(); // stop audio, throwing away buffered data |
2877 static vo_mpegpes_t *pkg=&packet; | 2879 static vo_mpegpes_t *pkg=&packet; |
2878 packet.timestamp=sh_video->timer*90000.0; | 2880 packet.timestamp=sh_video->timer*90000.0; |
2879 packet.id=0x20; /* Subpic */ | 2881 packet.id=0x20; /* Subpic */ |
2880 while((packet.size=ds_get_packet_sub(d_dvdsub,&packet.data))>0){ | 2882 while((packet.size=ds_get_packet_sub(d_dvdsub,&packet.data))>0){ |
2881 mp_msg(MSGT_CPLAYER,MSGL_V,"\rDVD sub: len=%d v_pts=%5.3f s_pts=%5.3f \n",packet.size,d_video->pts,d_dvdsub->pts); | 2883 mp_msg(MSGT_CPLAYER,MSGL_V,"\rDVD sub: len=%d v_pts=%5.3f s_pts=%5.3f \n",packet.size,d_video->pts,d_dvdsub->pts); |
2882 video_out->draw_frame(&pkg); | 2884 if(vo_config_count) video_out->draw_frame(&pkg); |
2883 } | 2885 } |
2884 }else if(vo_spudec){ | 2886 }else if(vo_spudec){ |
2885 unsigned char* packet=NULL; | 2887 unsigned char* packet=NULL; |
2886 int len; | 2888 int len; |
2887 current_module="spudec"; | 2889 current_module="spudec"; |