vo_config_count now counts calls to vo->config()
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@5512 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
1 parent
b909e60fe9
commit
69a4881d04
5 files changed
+26
-16
No files matched your search
+4
-1
@@ -19,6 +19,7 @@ static int config(struct vf_instance_s* vf,
|
||||
unsigned int flags, unsigned int outfmt){
|
||||
if(video_out->config(width,height,d_width,d_height,flags,"MPlayer",outfmt,NULL))
|
||||
return 0;
|
||||
++vo_config_count;
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -34,12 +35,13 @@ static int query_format(struct vf_instance_s* vf, unsigned int fmt){
|
||||
|
||||
static void get_image(struct vf_instance_s* vf,
|
||||
mp_image_t *mpi){
|
||||
if(vo_directrendering)
|
||||
if(vo_directrendering && vo_config_count)
|
||||
video_out->control(VOCTRL_GET_IMAGE,mpi);
|
||||
}
|
||||
|
||||
static void put_image(struct vf_instance_s* vf,
|
||||
mp_image_t *mpi){
|
||||
if(!vo_config_count) return; // vo not configured?
|
||||
// first check, maybe the vo/vf plugin implements draw_image using mpi:
|
||||
if(video_out->control(VOCTRL_DRAW_IMAGE,mpi)==VO_TRUE) return; // done.
|
||||
// nope, fallback to old draw_frame/draw_slice:
|
||||
@@ -54,6 +56,7 @@ static void put_image(struct vf_instance_s* vf,
|
||||
|
||||
static void draw_slice(struct vf_instance_s* vf,
|
||||
unsigned char* src, int* stride, int w,int h, int x, int y){
|
||||
if(!vo_config_count) return; // vo not configured?
|
||||
video_out->draw_slice(src,stride,w,h,x,y);
|
||||
}
|
||||
|
||||
|
||||
@@ -38,6 +38,8 @@ int vo_depthonscreen=0;
|
||||
int vo_screenwidth=0;
|
||||
int vo_screenheight=0;
|
||||
|
||||
int vo_config_count=0;
|
||||
|
||||
// requested resolution/bpp: (-x -y -bpp options)
|
||||
int vo_dx=0;
|
||||
int vo_dy=0;
|
||||
|
||||
@@ -191,6 +191,8 @@ extern vo_functions_t* video_out_drivers[];
|
||||
|
||||
extern int vo_flags;
|
||||
|
||||
extern int vo_config_count;
|
||||
|
||||
// correct resolution/bpp on screen: (should be autodetected by vo_init())
|
||||
extern int vo_depthonscreen;
|
||||
extern int vo_screenwidth;
|
||||
|
||||
+3
-2
@@ -106,8 +106,9 @@ codecs_t *vfw_codec = NULL;
|
||||
Video accelerated architecture
|
||||
**************************************************************************/
|
||||
vo_vaa_t vo_vaa;
|
||||
int vo_doublebuffering;
|
||||
int vo_directrendering;
|
||||
int vo_doublebuffering=0;
|
||||
int vo_directrendering=0;
|
||||
int vo_config_count=0;
|
||||
|
||||
//--------------------------
|
||||
|
||||
|
||||
@@ -310,7 +310,8 @@ void uninit_player(unsigned int mask){
|
||||
if(mask&INITED_VO){
|
||||
inited_flags&=~INITED_VO;
|
||||
current_module="uninit_vo";
|
||||
video_out->uninit(); video_out=NULL;
|
||||
video_out->uninit();
|
||||
video_out=NULL;
|
||||
}
|
||||
|
||||
if(mask&INITED_AO){
|
||||
@@ -1210,6 +1211,7 @@ if(!sh_video)
|
||||
|
||||
current_module="preinit_libvo";
|
||||
|
||||
vo_config_count=0;
|
||||
if((video_out->preinit(vo_subdevice))!=0){
|
||||
mp_msg(MSGT_CPLAYER,MSGL_FATAL,"Error opening/initializing the selected video_out (-vo) device!\n");
|
||||
goto goto_next_file; // exit_player(MSGTR_Exit_error);
|
||||
@@ -1538,7 +1540,7 @@ if(1)
|
||||
|
||||
//------------------------ add OSD to frame contents ---------
|
||||
current_module="draw_osd";
|
||||
video_out->draw_osd();
|
||||
if(vo_config_count) video_out->draw_osd();
|
||||
|
||||
current_module="av_sync";
|
||||
|
||||
@@ -1566,7 +1568,7 @@ if(1)
|
||||
#ifdef HAVE_NEW_GUI
|
||||
if(use_gui) guiEventHandling();
|
||||
#endif
|
||||
video_out->check_events(); // check events AST
|
||||
if(vo_config_count) video_out->check_events(); // check events AST
|
||||
} else {
|
||||
// It's time to sleep...
|
||||
current_module="sleep";
|
||||
@@ -1688,7 +1690,7 @@ if(!(vo_flags&256)){ // flag 256 means: libvo driver does its timing (dvb card)
|
||||
}
|
||||
|
||||
current_module="flip_page";
|
||||
video_out->check_events();
|
||||
if(vo_config_count) video_out->check_events();
|
||||
if(blit_frame){
|
||||
unsigned int t2=GetTimer();
|
||||
double tt;
|
||||
@@ -1703,7 +1705,7 @@ if(!(vo_flags&256)){ // flag 256 means: libvo driver does its timing (dvb card)
|
||||
too_slow_frame_cnt++;
|
||||
/* printf ("PANIC: too slow frame (%.3f)!\n", j); */
|
||||
|
||||
video_out->flip_page();
|
||||
if(vo_config_count) video_out->flip_page();
|
||||
t2=GetTimer()-t2;
|
||||
tt = t2*0.000001f;
|
||||
vout_time_usage+=tt;
|
||||
@@ -1865,7 +1867,7 @@ read_input:
|
||||
#ifdef HAVE_NEW_GUI
|
||||
if(use_gui) guiGetEvent( guiCEvent,(char *)guiSetPause );
|
||||
#endif
|
||||
if (video_out && sh_video)
|
||||
if (video_out && sh_video && vo_config_count)
|
||||
video_out->control(VOCTRL_PAUSE, NULL);
|
||||
|
||||
if (audio_out && sh_audio)
|
||||
@@ -1895,7 +1897,7 @@ read_input:
|
||||
#endif
|
||||
(use_stdin || getch2(20)<=0) && mplayer_get_key()<=0){
|
||||
#endif /* HAVE_NEW_INPUT */
|
||||
if(sh_video && video_out) video_out->check_events();
|
||||
if(sh_video && video_out && vo_config_count) video_out->check_events();
|
||||
#ifdef HAVE_NEW_GUI
|
||||
if(use_gui){
|
||||
guiEventHandling();
|
||||
@@ -1914,7 +1916,7 @@ read_input:
|
||||
osd_function=OSD_PLAY;
|
||||
if (audio_out && sh_audio)
|
||||
audio_out->resume(); // resume audio
|
||||
if (video_out && sh_video)
|
||||
if (video_out && sh_video && vo_config_count)
|
||||
video_out->control(VOCTRL_RESUME, NULL); // resume video
|
||||
(void)GetRelativeTime(); // keep TF around FT in next cycle
|
||||
#ifdef HAVE_NEW_GUI
|
||||
@@ -2113,7 +2115,7 @@ if (stream->type==STREAMTYPE_DVDNAV && dvd_nav_still)
|
||||
/* User wants to have screen shot */
|
||||
case 'S':
|
||||
case 's':
|
||||
video_out->control(VOCTRL_SCREENSHOT, NULL);
|
||||
if(vo_config_count) video_out->control(VOCTRL_SCREENSHOT, NULL);
|
||||
break;
|
||||
// Contrast:
|
||||
case '1':
|
||||
@@ -2253,7 +2255,7 @@ if (stream->type==STREAMTYPE_DVDNAV && dvd_nav_still)
|
||||
#endif
|
||||
|
||||
case 'f':
|
||||
video_out->control(VOCTRL_FULLSCREEN, 0);
|
||||
if(vo_config_count) video_out->control(VOCTRL_FULLSCREEN, 0);
|
||||
break;
|
||||
}
|
||||
} // keyboard event handler
|
||||
@@ -2476,7 +2478,7 @@ if (stream->type==STREAMTYPE_DVDNAV && dvd_nav_still)
|
||||
if ( use_gui ) guiGetEvent( guiIEvent,(char *)MP_CMD_GUI_FULLSCREEN );
|
||||
else
|
||||
#endif
|
||||
if(video_out) video_out->control(VOCTRL_FULLSCREEN, 0);
|
||||
if(video_out && vo_config_count) video_out->control(VOCTRL_FULLSCREEN, 0);
|
||||
} break;
|
||||
case MP_CMD_SUB_POS:
|
||||
{
|
||||
@@ -2732,7 +2734,7 @@ if(rel_seek_secs || abs_seek_pos){
|
||||
|
||||
if(sh_video){
|
||||
current_module="seek_video_reset";
|
||||
video_out->control(VOCTRL_RESET,NULL);
|
||||
if(vo_config_count) video_out->control(VOCTRL_RESET,NULL);
|
||||
}
|
||||
|
||||
if(sh_audio){
|
||||
@@ -2879,7 +2881,7 @@ if(rel_seek_secs || abs_seek_pos){
|
||||
packet.id=0x20; /* Subpic */
|
||||
while((packet.size=ds_get_packet_sub(d_dvdsub,&packet.data))>0){
|
||||
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);
|
||||
video_out->draw_frame(&pkg);
|
||||
if(vo_config_count) video_out->draw_frame(&pkg);
|
||||
}
|
||||
}else if(vo_spudec){
|
||||
unsigned char* packet=NULL;
|
||||
|
||||
Reference in new issue
Block a user