[Mplayerxp-cvslog] SF.net SVN: mplayerxp:[192] mplayerxp
Brought to you by:
olov
From: <nic...@us...> - 2012-10-24 13:00:50
|
Revision: 192 http://mplayerxp.svn.sourceforge.net/mplayerxp/?rev=192&view=rev Author: nickols_k Date: 2012-10-24 13:00:34 +0000 (Wed, 24 Oct 2012) Log Message: ----------- make libvo re-enterable Modified Paths: -------------- mplayerxp/cfg-mplayer.h mplayerxp/dec_ahead.c mplayerxp/find_sub.c mplayerxp/libao2/ao_alsa9.c mplayerxp/libao2/ao_nas.c mplayerxp/libao2/ao_wav.c mplayerxp/libmpcodecs/ad_vorbis.c mplayerxp/libmpcodecs/dec_video.c mplayerxp/libmpcodecs/vd.c mplayerxp/libmpdemux/demux_ogg.c mplayerxp/libmpdemux/s_dvdnav.c mplayerxp/libmpdemux/sub_cc.c mplayerxp/libmpdemux/sub_ty.c mplayerxp/libvo/sub.c mplayerxp/libvo/sub.h mplayerxp/libvo/video_out.c mplayerxp/libvo/video_out.h mplayerxp/libvo/video_out_internal.h mplayerxp/libvo/vo_dga.c mplayerxp/libvo/vo_fbdev.c mplayerxp/libvo/vo_null.c mplayerxp/libvo/vo_opengl.c mplayerxp/libvo/vo_sdl.c mplayerxp/libvo/vo_vesa.c mplayerxp/libvo/vo_x11.c mplayerxp/libvo/vo_xv.c mplayerxp/libvo/vo_xvidix.c mplayerxp/libvo/vosub_vidix.c mplayerxp/libvo/vosub_vidix.h mplayerxp/libvo/x11_common.c mplayerxp/libvo/x11_common.h mplayerxp/mplayer.c mplayerxp/postproc/af.h mplayerxp/postproc/libmenu/menu.c mplayerxp/postproc/libmenu/menu_list.c mplayerxp/postproc/libmenu/menu_txt.c mplayerxp/postproc/vf.c mplayerxp/postproc/vf_expand.c mplayerxp/postproc/vf_scale.c mplayerxp/postproc/vf_vo.c mplayerxp/spudec.c mplayerxp/spudec.h mplayerxp/subreader.h Modified: mplayerxp/cfg-mplayer.h =================================================================== --- mplayerxp/cfg-mplayer.h 2012-10-23 06:54:26 UTC (rev 191) +++ mplayerxp/cfg-mplayer.h 2012-10-24 13:00:34 UTC (rev 192) @@ -110,7 +110,7 @@ {"dump", &stream_dump, CONF_TYPE_STRING, 0, 0, 0, NULL, "specifies dump type and name for the dump of stream"}, {"gomp", &enable_gomp, CONF_TYPE_FLAG, 0, 0, 1, NULL, "enables usage of OpenMP extensions"}, {"nogomp", &enable_gomp, CONF_TYPE_FLAG, 0, 1, 0, NULL, "disables usage of OpenMP extensions"}, - {"da_buffs", &vo.da_buffs, CONF_TYPE_INT, CONF_RANGE, 4, 1024, NULL, "specifies number of buffers for decoding-ahead in XP mode"}, + {"da_buffs", &vo_conf.da_buffs, CONF_TYPE_INT, CONF_RANGE, 4, 1024, NULL, "specifies number of buffers for decoding-ahead in XP mode"}, {"cache", &stream_cache_size, CONF_TYPE_INT, CONF_RANGE, 4, 65536, NULL,"specifies amount of memory for precaching a file/URL"}, {"nocache", &stream_cache_size, CONF_TYPE_FLAG, 0, 1, 0, NULL,"disables precaching a file/URL"}, {"autoq", &auto_quality, CONF_TYPE_INT, CONF_RANGE, 0, 100, NULL, "dynamically changes the level of postprocessing depending on spare CPU time available"}, @@ -184,13 +184,13 @@ }; static const config_t veq_config[]={ - {"brightness",&vo.gamma.brightness, CONF_TYPE_INT, CONF_RANGE, -1000, 1000, NULL, "specifies brightness-level for output image"}, - {"saturation",&vo.gamma.saturation, CONF_TYPE_INT, CONF_RANGE, -1000, 1000, NULL, "specifies saturation-level for output image"}, - {"contrast",&vo.gamma.contrast, CONF_TYPE_INT, CONF_RANGE, -1000, 1000, NULL, "specifies contrast-level for output image"}, - {"hue",&vo.gamma.hue, CONF_TYPE_INT, CONF_RANGE, -1000, 1000, NULL, "specifies hue of gamma-correction for output image"}, - {"red",&vo.gamma.red_intensity, CONF_TYPE_INT, CONF_RANGE, -1000, 1000, NULL, "specifies intensity of red component for output image"}, - {"green",&vo.gamma.green_intensity, CONF_TYPE_INT, CONF_RANGE, -1000, 1000, NULL, "specifies intensity of green component for output image"}, - {"blue",&vo.gamma.blue_intensity, CONF_TYPE_INT, CONF_RANGE, -1000, 1000, NULL, "specifies intensity of blue component for output image"}, + {"brightness",&vo_conf.gamma.brightness, CONF_TYPE_INT, CONF_RANGE, -1000, 1000, NULL, "specifies brightness-level for output image"}, + {"saturation",&vo_conf.gamma.saturation, CONF_TYPE_INT, CONF_RANGE, -1000, 1000, NULL, "specifies saturation-level for output image"}, + {"contrast",&vo_conf.gamma.contrast, CONF_TYPE_INT, CONF_RANGE, -1000, 1000, NULL, "specifies contrast-level for output image"}, + {"hue",&vo_conf.gamma.hue, CONF_TYPE_INT, CONF_RANGE, -1000, 1000, NULL, "specifies hue of gamma-correction for output image"}, + {"red",&vo_conf.gamma.red_intensity, CONF_TYPE_INT, CONF_RANGE, -1000, 1000, NULL, "specifies intensity of red component for output image"}, + {"green",&vo_conf.gamma.green_intensity, CONF_TYPE_INT, CONF_RANGE, -1000, 1000, NULL, "specifies intensity of green component for output image"}, + {"blue",&vo_conf.gamma.blue_intensity, CONF_TYPE_INT, CONF_RANGE, -1000, 1000, NULL, "specifies intensity of blue component for output image"}, {NULL, NULL, 0, 0, 0, 0, NULL,NULL}, }; @@ -216,8 +216,8 @@ #endif {"mc", &default_max_pts_correction, CONF_TYPE_FLOAT, CONF_RANGE, 0, 10, NULL, "maximum sync correction per 5 frames (in seconds)"}, {"fps", &force_fps, CONF_TYPE_FLOAT, CONF_MIN, 0, 0, NULL, "forces frame rate (if value is wrong in the header)"}, - {"vsync", &vo.vsync, CONF_TYPE_FLAG, 0, 0, 1, NULL, "forces video hardware to wait VSYNC signal before frame switching"}, - {"novsync", &vo.vsync, CONF_TYPE_FLAG, 0, 1, 0, NULL, "disables video hardware to wait VSYNC signal before frame switching"}, + {"vsync", &vo_conf.vsync, CONF_TYPE_FLAG, 0, 0, 1, NULL, "forces video hardware to wait VSYNC signal before frame switching"}, + {"novsync", &vo_conf.vsync, CONF_TYPE_FLAG, 0, 1, 0, NULL, "disables video hardware to wait VSYNC signal before frame switching"}, {NULL, NULL, 0, 0, 0, 0, NULL,NULL}, }; @@ -250,9 +250,9 @@ #ifdef HAVE_X11 static const config_t x11_config[]={ - {"display", &vo.mDisplayName, CONF_TYPE_STRING, 0, 0, 0, NULL, "specifies the hostname and display number of the X server"}, - {"wid", &vo.WinID, CONF_TYPE_INT, 0, 0, 0, NULL, "tells MPlayerXP to use existing X11 window (for using MPlayerXP as plugin)"}, - {"rootwin", &vo.WinID, CONF_TYPE_FLAG, 0, -1, 0, NULL, "render movie in the root window (desktop background)"}, + {"display", &vo_conf.mDisplayName, CONF_TYPE_STRING, 0, 0, 0, NULL, "specifies the hostname and display number of the X server"}, + {"wid", &vo_conf.WinID, CONF_TYPE_INT, 0, 0, 0, NULL, "tells MPlayerXP to use existing X11 window (for using MPlayerXP as plugin)"}, + {"rootwin", &vo_conf.WinID, CONF_TYPE_FLAG, 0, -1, 0, NULL, "render movie in the root window (desktop background)"}, #ifdef HAVE_XINERAMA {"xinerama", &xinerama_screen, CONF_TYPE_INT, CONF_RANGE, 0, 32, NULL, "tells MPlayerXP the display for movie playback"}, #endif @@ -277,28 +277,28 @@ static const config_t video_config[]={ {"on", &has_video, CONF_TYPE_FLAG, 0, 0, 1, NULL, "enables video-steam playback"}, {"off", &has_video, CONF_TYPE_FLAG, 0, 1, 0, NULL, "disables video-stream playback"}, - {"width", &vo.opt_screen_size_x, CONF_TYPE_INT, CONF_RANGE, 0, 4096, NULL, "scale output image to width (if driver supports)"}, - {"height", &vo.opt_screen_size_y, CONF_TYPE_INT, CONF_RANGE, 0, 4096, NULL, "scale output image to height (if driver supports)"}, - {"zoom", &vo.screen_size_xy, CONF_TYPE_FLOAT, CONF_RANGE, 0, 4096, NULL, "scale output image by given factor"}, - {"screenw", &vo.screenwidth, CONF_TYPE_INT, CONF_RANGE, 0, 4096, NULL, "specifies the horizontal resolution of the screen (if supported)"}, - {"screenh", &vo.screenheight, CONF_TYPE_INT, CONF_RANGE, 0, 4096, NULL, "specifies the vertical resolution of the screen (if supported)"}, + {"width", &vo_conf.opt_screen_size_x, CONF_TYPE_INT, CONF_RANGE, 0, 4096, NULL, "scale output image to width (if driver supports)"}, + {"height", &vo_conf.opt_screen_size_y, CONF_TYPE_INT, CONF_RANGE, 0, 4096, NULL, "scale output image to height (if driver supports)"}, + {"zoom", &vo_conf.screen_size_xy, CONF_TYPE_FLOAT, CONF_RANGE, 0, 4096, NULL, "scale output image by given factor"}, + {"screenw", &vo_conf.screenwidth, CONF_TYPE_INT, CONF_RANGE, 0, 4096, NULL, "specifies the horizontal resolution of the screen (if supported)"}, + {"screenh", &vo_conf.screenheight, CONF_TYPE_INT, CONF_RANGE, 0, 4096, NULL, "specifies the vertical resolution of the screen (if supported)"}, {"speed", &playbackspeed_factor, CONF_TYPE_FLOAT, CONF_RANGE, 0.01, 100.0, NULL, "sets playback speed factor"}, - {"aspect", &vo.movie_aspect, CONF_TYPE_FLOAT, CONF_RANGE, 0.2, 3.0, NULL, "sets aspect-ratio of movies (autodetect)"}, - {"noaspect", &vo.movie_aspect, CONF_TYPE_FLAG, 0, 0, 0, NULL, "unsets aspect-ratio of movies"}, - {"aspect-ratio", &vo.softzoom, CONF_TYPE_FLAG, 0, 0, 1, NULL, "keeps aspect-ratio of the movie during window resize"}, - {"noaspect-ratio", &vo.softzoom, CONF_TYPE_FLAG, 0, 1, 0, NULL, "render movie to the user-defined window's geometry"}, + {"aspect", &vo_conf.movie_aspect, CONF_TYPE_FLOAT, CONF_RANGE, 0.2, 3.0, NULL, "sets aspect-ratio of movies (autodetect)"}, + {"noaspect", &vo_conf.movie_aspect, CONF_TYPE_FLAG, 0, 0, 0, NULL, "unsets aspect-ratio of movies"}, + {"aspect-ratio", &vo_conf.softzoom, CONF_TYPE_FLAG, 0, 0, 1, NULL, "keeps aspect-ratio of the movie during window resize"}, + {"noaspect-ratio", &vo_conf.softzoom, CONF_TYPE_FLAG, 0, 1, 0, NULL, "render movie to the user-defined window's geometry"}, {"monitorpixelaspect", &monitor_pixel_aspect, CONF_TYPE_FLOAT, CONF_RANGE, 0.2, 9.0, NULL, "sets the aspect-ratio of a single pixel of TV screen"}, - {"vm", &vo.vidmode, CONF_TYPE_FLAG, 0, 0, 1, NULL, "enables video-mode changing during playback"}, - {"novm", &vo.vidmode, CONF_TYPE_FLAG, 0, 1, 0, NULL, "disables video-mode changing during playback"}, - {"fs", &vo.fullscreen, CONF_TYPE_FLAG, 0, 0, 1, NULL, "fullscreen playback"}, - {"nofs", &vo.fullscreen, CONF_TYPE_FLAG, 0, 1, 0, NULL, "windowed playback"}, - {"fsmode", &vo.fsmode, CONF_TYPE_INT, CONF_RANGE, 0, 15, NULL, "enables workaround for some fullscreen related problems"}, - {"flip", &vo.flip, CONF_TYPE_FLAG, 0, -1, 1, NULL, "flip output image upside-down"}, - {"noflip", &vo.flip, CONF_TYPE_FLAG, 0, -1, 0, NULL, "render output image as is"}, - {"bpp", &vo.dbpp, CONF_TYPE_INT, CONF_RANGE, 0, 32, NULL, "use different color depth than autodetect"}, - {"bm", &vo.use_bm, CONF_TYPE_FLAG, 0, 0, 1, NULL, "enables using of bus-mastering (if it available for given OS/videocard)"}, - {"bm2", &vo.use_bm, CONF_TYPE_FLAG, 0, 0, 2, NULL, "enables using of bus-mastering to store all decoded-ahead frames in video-memory"}, - {"nobm", &vo.use_bm, CONF_TYPE_FLAG, 0, 1, 0, NULL, "disables using of bus-mastering"}, + {"vm", &vo_conf.vidmode, CONF_TYPE_FLAG, 0, 0, 1, NULL, "enables video-mode changing during playback"}, + {"novm", &vo_conf.vidmode, CONF_TYPE_FLAG, 0, 1, 0, NULL, "disables video-mode changing during playback"}, + {"fs", &vo_conf.fullscreen, CONF_TYPE_FLAG, 0, 0, 1, NULL, "fullscreen playback"}, + {"nofs", &vo_conf.fullscreen, CONF_TYPE_FLAG, 0, 1, 0, NULL, "windowed playback"}, + {"fsmode", &vo_conf.fsmode, CONF_TYPE_INT, CONF_RANGE, 0, 15, NULL, "enables workaround for some fullscreen related problems"}, + {"flip", &vo_conf.flip, CONF_TYPE_FLAG, 0, -1, 1, NULL, "flip output image upside-down"}, + {"noflip", &vo_conf.flip, CONF_TYPE_FLAG, 0, -1, 0, NULL, "render output image as is"}, + {"bpp", &vo_conf.dbpp, CONF_TYPE_INT, CONF_RANGE, 0, 32, NULL, "use different color depth than autodetect"}, + {"bm", &vo_conf.use_bm, CONF_TYPE_FLAG, 0, 0, 1, NULL, "enables using of bus-mastering (if it available for given OS/videocard)"}, + {"bm2", &vo_conf.use_bm, CONF_TYPE_FLAG, 0, 0, 2, NULL, "enables using of bus-mastering to store all decoded-ahead frames in video-memory"}, + {"nobm", &vo_conf.use_bm, CONF_TYPE_FLAG, 0, 1, 0, NULL, "disables using of bus-mastering"}, {"id", &video_id, CONF_TYPE_INT, CONF_RANGE, 0, 255, NULL, "selects video channel"}, {"pp", &npp_options, CONF_TYPE_STRING, 0, 0, 0, NULL, "specifies options of post-processing"}, {"sws", &sws_flags, CONF_TYPE_INT, 0, 0, 2, NULL, "specifies the quality of the software scaler"}, Modified: mplayerxp/dec_ahead.c =================================================================== --- mplayerxp/dec_ahead.c 2012-10-23 06:54:26 UTC (rev 191) +++ mplayerxp/dec_ahead.c 2012-10-24 13:00:34 UTC (rev 192) @@ -170,6 +170,8 @@ static volatile int pthread_audio_end_of_work=0; int xp_is_bad_pts=0; + +extern vo_data_t* vo_data; /* this routine decodes video+audio but intends to be video only */ static void show_warn_cant_sync(float max_frame_delay) { @@ -182,7 +184,7 @@ "*********************************************\n" "Try increase number of buffer for decoding ahead\n" "Exist: %u, need: %u\n" - ,xp_num_frames,(unsigned)(max_frame_delay*3*vo.fps)+3); + ,xp_num_frames,(unsigned)(max_frame_delay*3*vo_data->fps)+3); prev_warn_delay=max_frame_delay; } } @@ -210,7 +212,7 @@ */ delta=v_pts-xp_screen_pts; if(max_frame_delay*3 > drop_barrier) { - if(drop_barrier < (float)(xp_num_frames-2)/vo.fps) drop_barrier += 1/vo.fps; + if(drop_barrier < (float)(xp_num_frames-2)/vo_data->fps) drop_barrier += 1/vo_data->fps; else if(verbose) show_warn_cant_sync(max_frame_delay); } @@ -287,7 +289,7 @@ dec_ahead_pth_id = pinfo[_xp_id].pth_id = pthread_self(); pinfo[_xp_id].thread_name = (xp_core.has_audio && enable_xp < XP_VAFull) ? "video+audio decoding+filtering ahead" : "video decoding+vf ahead"; - drop_barrier=(float)(xp_num_frames/2)*(1/vo.fps); + drop_barrier=(float)(xp_num_frames/2)*(1/vo_data->fps); if(av_sync_pts == -1 && !use_pts_fix2) xp_is_bad_pts = d_video->demuxer->file_format == DEMUXER_TYPE_MPEG_ES || d_video->demuxer->file_format == DEMUXER_TYPE_MPEG4_ES || @@ -322,11 +324,9 @@ } #endif /*-------------------- Decode a frame: -----------------------*/ - in_size=video_read_frame_r(sh_video,&duration,&v_pts,&start,vo.fps); + in_size=video_read_frame_r(sh_video,&duration,&v_pts,&start,vo_data->fps); if(xp_core.in_lseek==Seek) { pinfo[_xp_id].current_module = "Post seek"; - /* reset counters */ - dae_reset(xp_core.video); if(xp_is_bad_pts) mpeg_timer=HUGE; xp_core.in_lseek=NoSeek; MSG_T("\nDEC_AHEAD: reset counters to (%u %u) due lseek\n",dec_ahead_locked_frame,abs_dec_ahead_locked_frame); @@ -361,7 +361,7 @@ int cur_time; cur_time = GetTimerMS(); /* Ugly solution: disable frame dropping right after seeking! */ - if(cur_time - mpxp_seek_time > (xp_num_frames/vo.fps)*100) xp_n_frame_to_drop=compute_frame_dropping(v_pts,drop_barrier); + if(cur_time - mpxp_seek_time > (xp_num_frames/vo_data->fps)*100) xp_n_frame_to_drop=compute_frame_dropping(v_pts,drop_barrier); } /* if( frame_dropping ) */ if(xp_core.in_lseek!=NoSeek) continue; #if 0 @@ -598,7 +598,7 @@ unsigned o_bps; unsigned min_reserv; o_bps=sh_audio->afilter_inited?sh_audio->af_bps:sh_audio->o_bps; - if(xp_core.has_video) asize = max(3*sha->audio_out_minsize,max(3*MAX_OUTBURST,o_bps*xp_num_frames/vo.fps))+MIN_BUFFER_RESERV; + if(xp_core.has_video) asize = max(3*sha->audio_out_minsize,max(3*MAX_OUTBURST,o_bps*xp_num_frames/vo_data->fps))+MIN_BUFFER_RESERV; else asize = o_bps*ao_da_buffs; /* FIXME: get better indices from asize/real_audio_packet_size */ min_reserv = sha->audio_out_minsize; @@ -693,6 +693,10 @@ /* Restart threads after seek */ void dec_ahead_restart_threads(int xp_id) { + /* reset counters */ + dae_reset(xp_core.video); + /* tempoarry solution */ + reset_audio_buffer(); /* Ugly hack: but we should read audio packet before video after seeking. Else we'll get picture destortion on the screen */ initial_audio_pts=HUGE; @@ -752,7 +756,7 @@ if(xp_core.has_video) { /* Match video buffer */ vbuf_size = dae_get_decoder_outrun(xp_core.video); - pref_buf = vbuf_size / vo.fps * sh_audio->af_bps; + pref_buf = vbuf_size / vo_data->fps * sh_audio->af_bps; pref_buf -= len; if( pref_buf > 0 ) { len = min( pref_buf, free_buf ); Modified: mplayerxp/find_sub.c =================================================================== --- mplayerxp/find_sub.c 2012-10-23 06:54:26 UTC (rev 191) +++ mplayerxp/find_sub.c 2012-10-24 13:00:34 UTC (rev 192) @@ -20,13 +20,14 @@ static unsigned long nosub_range_start=ULONG_MAX; static unsigned long nosub_range_end=ULONG_MAX; -void find_sub(subtitle* subtitles,unsigned long key){ +void find_sub(subtitle* subtitles,unsigned long key,any_t*vo_data){ int i,j; - + vo_data_t*vo=vo_data; + if ( !subtitles ) return; - - if(vo.sub){ - if(key>=vo.sub->start && key<=vo.sub->end) return; // OK! + + if(vo->sub){ + if(key>=vo->sub->start && key<=vo->sub->end) return; // OK! } else { if(key>nosub_range_start && key<nosub_range_end) return; // OK! } @@ -36,45 +37,43 @@ vo_osd_changed(OSDTYPE_SUBTITLE); if(key<=0){ - vo.sub=NULL; // no sub here + vo->sub=NULL; // no sub here return; } - - + // check next sub. if(current_sub>=0 && current_sub+1<sub_num){ if(key>subtitles[current_sub].end && key<subtitles[current_sub+1].start){ // no sub nosub_range_start=subtitles[current_sub].end; nosub_range_end=subtitles[current_sub+1].start; - vo.sub=NULL; + vo->sub=NULL; return; } // next sub? ++current_sub; - vo.sub=&subtitles[current_sub]; - if(key>=vo.sub->start && key<=vo.sub->end) return; // OK! + vo->sub=&subtitles[current_sub]; + if(key>=vo->sub->start && key<=vo->sub->end) return; // OK! } - // use logarithmic search: i=0;j=sub_num-1; while(j>=i){ current_sub=(i+j+1)/2; - vo.sub=&subtitles[current_sub]; - if(key<vo.sub->start) j=current_sub-1; - else if(key>vo.sub->end) i=current_sub+1; + vo->sub=&subtitles[current_sub]; + if(key<vo->sub->start) j=current_sub-1; + else if(key>vo->sub->end) i=current_sub+1; else return; // found! } -// if(key>=vo.sub->start && key<=vo.sub->end) return; // OK! - +// if(key>=vo->sub->start && key<=vo->sub->end) return; // OK! + // check where are we... - if(key<vo.sub->start){ + if(key<vo->sub->start){ if(current_sub<=0){ // before the first sub nosub_range_start=key-1; // tricky - nosub_range_end=vo.sub->start; - vo.sub=NULL; + nosub_range_end=vo->sub->start; + vo->sub=NULL; return; } --current_sub; @@ -82,31 +81,31 @@ // no sub nosub_range_start=subtitles[current_sub].end; nosub_range_end=subtitles[current_sub+1].start; - vo.sub=NULL; + vo->sub=NULL; return; } MSG_V("HEH???? "); } else { - if(key<=vo.sub->end) MSG_V("JAJJ! "); else + if(key<=vo->sub->end) MSG_V("JAJJ! "); else if(current_sub+1>=sub_num){ // at the end? - nosub_range_start=vo.sub->end; + nosub_range_start=vo->sub->end; nosub_range_end=0x7FFFFFFF; // MAXINT - vo.sub=NULL; + vo->sub=NULL; return; } else if(key>subtitles[current_sub].end && key<subtitles[current_sub+1].start){ // no sub nosub_range_start=subtitles[current_sub].end; nosub_range_end=subtitles[current_sub+1].start; - vo.sub=NULL; + vo->sub=NULL; return; } } - MSG_ERR("SUB ERROR: %d ? %d --- %d [%d] \n",key,(int)vo.sub->start,(int)vo.sub->end,current_sub); + MSG_ERR("SUB ERROR: %d ? %d --- %d [%d] \n",key,(int)vo->sub->start,(int)vo->sub->end,current_sub); - vo.sub=NULL; // no sub here + vo->sub=NULL; // no sub here } #endif Modified: mplayerxp/libao2/ao_alsa9.c =================================================================== --- mplayerxp/libao2/ao_alsa9.c 2012-10-23 06:54:26 UTC (rev 191) +++ mplayerxp/libao2/ao_alsa9.c 2012-10-24 13:00:34 UTC (rev 192) @@ -767,7 +767,7 @@ { unsigned result; UNUSED(flags); - MSG_DBG2("[ao_alsa] %s playing %i bytes\n",priv->ao_mmap?"mmap":"normal",len); + MSG_DBG2("[ao_alsa] %s playing %i bytes\n",priv_conf.mmap?"mmap":"normal",len); if (priv_conf.mmap) result = play_mmap(ao,data, len); else result = play_normal(ao,data, len); return result; Modified: mplayerxp/libao2/ao_nas.c =================================================================== --- mplayerxp/libao2/ao_nas.c 2012-10-23 06:54:26 UTC (rev 191) +++ mplayerxp/libao2/ao_nas.c 2012-10-24 13:00:34 UTC (rev 192) @@ -97,7 +97,7 @@ "Hardware", "Any" }; -#if 0 +#ifdef MP_DEBUG static const char* nas_reason(unsigned int reason) { if (reason > 6) reason = 6; @@ -120,6 +120,7 @@ return nas_states[state]; } #endif + static const ao_info_t info = { "NAS audio output", Modified: mplayerxp/libao2/ao_wav.c =================================================================== --- mplayerxp/libao2/ao_wav.c 2012-10-23 06:54:26 UTC (rev 191) +++ mplayerxp/libao2/ao_wav.c 2012-10-24 13:00:34 UTC (rev 192) @@ -218,10 +218,11 @@ } // return: how many bytes can be played without blocking +extern vo_data_t* vo_data; static unsigned get_space(ao_data_t* ao){ priv_t* priv=ao->priv; - if(vo.pts) - return ao->pts < vo.pts + priv->fast * 30000 ? ao->outburst : 0; + if(vo_data->pts) + return ao->pts < vo_data->pts + priv->fast * 30000 ? ao->outburst : 0; return ao->outburst; } Modified: mplayerxp/libmpcodecs/ad_vorbis.c =================================================================== --- mplayerxp/libmpcodecs/ad_vorbis.c 2012-10-23 06:54:26 UTC (rev 191) +++ mplayerxp/libmpcodecs/ad_vorbis.c 2012-10-24 13:00:34 UTC (rev 192) @@ -8,7 +8,9 @@ #include "libao2/afmt.h" #include "libao2/audio_out.h" -static const ad_info_t info = +extern ao_data_t* ao_data; + +static const ad_info_t info = { "Ogg/Vorbis audio decoder", "libvorbis", @@ -86,7 +88,7 @@ } // Setup the decoder - sh->channels=ov->vi.channels; + sh->channels=ov->vi.channels; sh->samplerate=ov->vi.rate; #ifdef WORDS_BIGENDIAN #define OGG_FMT32 AFMT_S32_BE @@ -99,7 +101,7 @@ #endif sh->samplesize=2; sh->sample_format=OGG_FMT16; - if(ao_control(AOCONTROL_QUERY_FORMAT,OGG_FMT32) == CONTROL_OK) + if(ao_control(ao_data,AOCONTROL_QUERY_FORMAT,OGG_FMT32) == CONTROL_OK) { sh->samplesize=4; sh->sample_format=OGG_FMT32; Modified: mplayerxp/libmpcodecs/dec_video.c =================================================================== --- mplayerxp/libmpcodecs/dec_video.c 2012-10-23 06:54:26 UTC (rev 191) +++ mplayerxp/libmpcodecs/dec_video.c 2012-10-24 13:00:34 UTC (rev 192) @@ -84,6 +84,8 @@ sh_video->inited=0; } +#include "libvo/video_out.h" +extern vo_data_t*vo_data; #define MPDEC_THREAD_COND (VF_FLAGS_THREADS|VF_FLAGS_SLICES) static unsigned smp_num_cpus=1; static unsigned use_vf_threads=0; @@ -234,6 +236,7 @@ } } +extern vo_data_t* vo_data; static void update_subtitle(sh_video_t *sh_video,float v_pts,unsigned idx); int mpcv_decode(sh_video_t *sh_video,unsigned char *start,int in_size,int drop_frame, float pts){ vf_instance_t* vf; @@ -267,7 +270,7 @@ if(drop_frame) return 0; update_subtitle(sh_video,pts,mpi->xp_idx); - vo_flush_page(dae_curr_vdecoded()); + vo_flush_page(vo_data,dae_curr_vdecoded()); t2=GetTimer()-t2; tt=t2*0.000001f; @@ -302,7 +305,7 @@ if(sub_fps==0) sub_fps=sh_video->fps; pinfo[xp_id].current_module="find_sub"; if (pts > sub_last_pts || pts < sub_last_pts-1.0 ) { - find_sub(mp_subtitles,sub_uses_time?(100*pts):(pts*sub_fps)); // FIXME! frame counter... + find_sub(mp_subtitles,sub_uses_time?(100*pts):(pts*sub_fps),vo_data); // FIXME! frame counter... sub_last_pts = pts; } pinfo[xp_id].current_module=NULL; @@ -322,31 +325,31 @@ } }else #endif - if(vo.spudec){ + if(vo_data->spudec){ unsigned char* packet=NULL; int len,timestamp; pinfo[xp_id].current_module="spudec"; - spudec_now_pts(vo.spudec,90000*v_pts); - if(spudec_visible(vo.spudec)) { - vo_draw_spudec_direct(xp_idx); + spudec_now_pts(vo_data->spudec,90000*v_pts); + if(spudec_visible(vo_data->spudec)) { + vo_draw_spudec_direct(vo_data,xp_idx); } else { - spudec_heartbeat(vo.spudec,90000*v_pts); - if (vo.vobsub) { + spudec_heartbeat(vo_data->spudec,90000*v_pts); + if (vo_data->vobsub) { if (v_pts >= 0) { - while((len=vobsub_get_packet(vo.vobsub, v_pts,(any_t**)&packet, ×tamp))>0){ + while((len=vobsub_get_packet(vo_data->vobsub, v_pts,(any_t**)&packet, ×tamp))>0){ timestamp -= (v_pts - sh_video->timer)*90000; MSG_V("\rVOB sub: len=%d v_pts=%5.3f v_timer=%5.3f sub=%5.3f ts=%d \n",len,v_pts,sh_video->timer,timestamp / 90000.0,timestamp); - spudec_assemble(vo.spudec,packet,len,90000*d_dvdsub->pts); + spudec_assemble(vo_data->spudec,packet,len,90000*d_dvdsub->pts); } } } else { while((len=ds_get_packet_sub_r(d_dvdsub,&packet))>0){ MSG_V("\rDVD sub: len=%d v_pts=%5.3f s_pts=%5.3f \n",len,v_pts,d_dvdsub->pts); - spudec_assemble(vo.spudec,packet,len,90000*d_dvdsub->pts); + spudec_assemble(vo_data->spudec,packet,len,90000*d_dvdsub->pts); } } /* detect wether the sub has changed or not */ - if(spudec_changed(vo.spudec)) vo_draw_spudec_direct(xp_idx); + if(spudec_changed(vo_data->spudec)) vo_draw_spudec_direct(vo_data,xp_idx); pinfo[xp_id].current_module=NULL; } } Modified: mplayerxp/libmpcodecs/vd.c =================================================================== --- mplayerxp/libmpcodecs/vd.c 2012-10-23 06:54:26 UTC (rev 191) +++ mplayerxp/libmpcodecs/vd.c 2012-10-24 13:00:34 UTC (rev 192) @@ -97,6 +97,7 @@ #include "libvo/video_out.h" +extern vo_data_t* vo_data; extern const vd_functions_t* mpvdec; // FIXME! int mpcodecs_config_vo(sh_video_t *sh, int w, int h, any_t*tune){ @@ -138,10 +139,11 @@ MSG_DBG2("vo_debug: codec[%s] query_format(%s) returned FALSE\n",mpvdec->info->driver_name,vo_format_name(out_fmt)); continue; } - j=i; vo.flags=flags; + j=i; + /*vo_data->flags=flags;*/ if(flags&VFCAP_CSP_SUPPORTED_BY_HW) break; } else - if(!palette && !(vo.flags&3) && (out_fmt==IMGFMT_RGB8||out_fmt==IMGFMT_BGR8)){ + if(!palette && !(vo_data->flags&3) && (out_fmt==IMGFMT_RGB8||out_fmt==IMGFMT_BGR8)){ sh->outfmtidx=j; // pass index to the control() function this way if(mpvdec->control(sh,VDCTRL_QUERY_FORMAT,&out_fmt)!=CONTROL_FALSE) palette=1; @@ -165,8 +167,8 @@ palette=-1; vf=vf_open_filter(vf,sh,"palette",NULL); goto csp_again; - } else - { // sws failed, if the last filter (vf_vo) support MPEGPES try to append vf_lavc + } else { + // sws failed, if the last filter (vf_vo) support MPEGPES try to append vf_lavc vf_instance_t* voi, *vp = NULL, *ve; // Remove the scale filter if we added it ourself if(vf == sc) { @@ -182,30 +184,31 @@ sh->vfilter_inited=-1; return 0; // failed } + out_fmt=sh->codec->outfmt[j]; sh->outfmtidx=j; sh->vfilter=vf; // autodetect flipping - if(vo.flip==-1){ - vo.flip=0; + if(vo_conf.flip==0){ + VO_FLIP_UNSET(vo_data); if(sh->codec->outflags[j]&CODECS_FLAG_FLIP) if(!(sh->codec->outflags[j]&CODECS_FLAG_NOFLIP)) - vo.flip=1; + VO_FLIP_SET(vo_data); } - if(vo.flags&VFCAP_FLIPPED) vo.flip^=1; - if(vo.flip && !(vo.flags&VFCAP_FLIP)){ + if(vo_data->flags&VFCAP_FLIPPED) VO_FLIP_REVERT(vo_data); + if(VO_FLIP(vo_data) && !(vo_data->flags&VFCAP_FLIP)){ // we need to flip, but no flipping filter avail. sh->vfilter=vf=vf_open_filter(vf,sh,"mirror","x"); } // time to do aspect ratio corrections... - if(vo.movie_aspect>-1.0) sh->aspect = vo.movie_aspect; // cmdline overrides autodetect - if(vo.opt_screen_size_x||vo.opt_screen_size_y){ - screen_size_x = vo.opt_screen_size_x; - screen_size_y = vo.opt_screen_size_y; - if(!vo.vidmode){ + if(vo_conf.movie_aspect>-1.0) sh->aspect = vo_conf.movie_aspect; // cmdline overrides autodetect + if(vo_conf.opt_screen_size_x||vo_conf.opt_screen_size_y){ + screen_size_x = vo_conf.opt_screen_size_x; + screen_size_y = vo_conf.opt_screen_size_y; + if(!vo_conf.vidmode){ if(!screen_size_x) screen_size_x=1; if(!screen_size_y) screen_size_y=1; if(screen_size_x<=8) screen_size_x*=sh->disp_w; @@ -215,15 +218,15 @@ // check source format aspect, calculate prescale ::atmos screen_size_x=sh->disp_w; screen_size_y=sh->disp_h; - if(vo.screen_size_xy>=0.001){ - if(vo.screen_size_xy<=8){ + if(vo_conf.screen_size_xy>=0.001){ + if(vo_conf.screen_size_xy<=8){ // -xy means x+y scale - screen_size_x*=vo.screen_size_xy; - screen_size_y*=vo.screen_size_xy; + screen_size_x*=vo_conf.screen_size_xy; + screen_size_y*=vo_conf.screen_size_xy; } else { // -xy means forced width while keeping correct aspect - screen_size_x=vo.screen_size_xy; - screen_size_y=vo.screen_size_xy*sh->disp_h/sh->disp_w; + screen_size_x=vo_conf.screen_size_xy; + screen_size_y=vo_conf.screen_size_xy*sh->disp_h/sh->disp_w; } } if(sh->aspect>0.01){ @@ -232,7 +235,7 @@ sh->aspect); _w=(int)((float)screen_size_y*sh->aspect); _w+=_w%2; // round // we don't like horizontal downscale || user forced width: - if(_w<screen_size_x || vo.screen_size_xy>8){ + if(_w<screen_size_x || vo_conf.screen_size_xy>8){ screen_size_y=(int)((float)screen_size_x*(1.0/sh->aspect)); screen_size_y+=screen_size_y%2; // round if(screen_size_y<sh->disp_h) // Do not downscale verticaly @@ -243,16 +246,16 @@ } } - MSG_V("video_out->init(%dx%d->%dx%d,flags=%d,'%s',%s)\n", + MSG_V("vf->config(%dx%d->%dx%d,flags=0x%x,'%s',%s)\n", sh->disp_w,sh->disp_h, screen_size_x,screen_size_y, - vo.fullscreen|(vo.vidmode<<1)|(vo.softzoom<<2)|(vo.flip<<3), + vo_data->flags, "MPlayerXP",vo_format_name(out_fmt)); MSG_DBG2("vf configuring: %s\n",vf->info->name); if(vf->config(vf,sh->disp_w,sh->disp_h, screen_size_x,screen_size_y, - vo.fullscreen|(vo.vidmode<<1)|(vo.softzoom<<2)|(vo.flip<<3), + vo_data->flags, out_fmt,tune)==0){ MSG_WARN(MSGTR_CannotInitVO); sh->vfilter_inited=-1; @@ -261,7 +264,7 @@ MSG_DBG2("vf->config(%dx%d->%dx%d,flags=%d,'%s',%p)\n", sh->disp_w,sh->disp_h, screen_size_x,screen_size_y, - vo.fullscreen|(vo.vidmode<<1)|(vo.softzoom<<2)|(vo.flip<<3), + vo_data->flags, vo_format_name(out_fmt),tune); return 1; } Modified: mplayerxp/libmpdemux/demux_ogg.c =================================================================== --- mplayerxp/libmpdemux/demux_ogg.c 2012-10-23 06:54:26 UTC (rev 191) +++ mplayerxp/libmpdemux/demux_ogg.c 2012-10-24 13:00:34 UTC (rev 192) @@ -28,6 +28,8 @@ #define FOURCC_VORBIS mmioFOURCC('v', 'r', 'b', 's') #define FOURCC_THEORA mmioFOURCC('t', 'h', 'e', 'o') +extern vo_data_t* vo_data; + /// Vorbis decoder context : we need the vorbis_info for vorbis timestamping /// Shall we put this struct def in a common header ? typedef struct ov_struct_st { @@ -291,7 +293,7 @@ #ifdef USE_ICONV subcp_recode1(&ogg_sub); #endif - vo.sub = &ogg_sub; + vo_data->sub = &ogg_sub; vo_osd_changed(OSDTYPE_SUBTITLE); } @@ -554,7 +556,7 @@ /// Clear subtitles if necessary (for broken files) if ((clear_sub > 0) && (pts >= clear_sub)) { ogg_sub.lines = 0; - vo.sub = &ogg_sub; + vo_data->sub = &ogg_sub; vo_osd_changed(OSDTYPE_SUBTITLE); clear_sub = -1; } @@ -1412,7 +1414,7 @@ } if(!precision && (is_keyframe || os->vorbis) ) { ogg_sub.lines = 0; - vo.sub = &ogg_sub; + vo_data->sub = &ogg_sub; vo_osd_changed(OSDTYPE_SUBTITLE); clear_sub = -1; demux_ogg_add_packet(ds,os,ds->id,&op); Modified: mplayerxp/libmpdemux/s_dvdnav.c =================================================================== --- mplayerxp/libmpdemux/s_dvdnav.c 2012-10-23 06:54:26 UTC (rev 191) +++ mplayerxp/libmpdemux/s_dvdnav.c 2012-10-24 13:00:34 UTC (rev 192) @@ -29,6 +29,8 @@ #define max(a,b) ((a)>(b)?(a):(b)) #endif +extern vo_data_t* vo_data; + typedef struct { dvdnav_t * dvdnav; /* handle to libdvdnav stuff */ char * filename; /* path */ @@ -509,12 +511,12 @@ stream_change->physical_letterbox, stream_change->physical_pan_scan, stream_change->logical); - if (vo.spudec && dvdsub_id!=stream_change->physical_wide) { + if (vo_data->spudec && dvdsub_id!=stream_change->physical_wide) { MSG_DBG2("d_dvdsub->id change: was %d is now %d\n", d_dvdsub->id,stream_change->physical_wide); // FIXME: need a better way to change SPU id d_dvdsub->id=dvdsub_id=stream_change->physical_wide; - if (vo.spudec) spudec_reset(vo.spudec); + if (vo_data->spudec) spudec_reset(vo_data->spudec); } break; } @@ -560,7 +562,7 @@ MSG_DBG2("DVDNAV Event: Nav SPU CLUT Change\n"); if(sp->len!=64) MSG_WARN("DVDNAV Event: Nav SPU CLUT Change: %i bytes <> 64\n",sp->len); // send new palette to SPU decoder - if (vo.spudec) spudec_update_palette(vo.spudec,(const unsigned int *)(sp->buf)); + if (vo_data->spudec) spudec_update_palette(vo_data->spudec,(const unsigned int *)(sp->buf)); break; } } Modified: mplayerxp/libmpdemux/sub_cc.c =================================================================== --- mplayerxp/libmpdemux/sub_cc.c 2012-10-23 06:54:26 UTC (rev 191) +++ mplayerxp/libmpdemux/sub_cc.c 2012-10-24 13:00:34 UTC (rev 192) @@ -149,17 +149,18 @@ bb=foo; } +extern vo_data_t* vo_data; static void display_buffer(const subtitle * buf) { - vo.sub=buf; + vo_data->sub=buf; vo_osd_changed(OSDTYPE_SUBTITLE); } static void cc_decode_EIA608(unsigned short int data) { - - static unsigned short int lastcode=0x0000; + + static unsigned short int lastcode=0x0000; unsigned char c1 = data & 0x7f; unsigned char c2 = (data >> 8) & 0x7f; Modified: mplayerxp/libmpdemux/sub_ty.c =================================================================== --- mplayerxp/libmpdemux/sub_ty.c 2012-10-23 06:54:26 UTC (rev 191) +++ mplayerxp/libmpdemux/sub_ty.c 2012-10-24 13:00:34 UTC (rev 192) @@ -20,6 +20,8 @@ #include "../libvo/video_out.h" #include "demux_msg.h" +extern vo_data_t* vo_data; + extern int sub_justify; #define TY_TEXT_MODE ( 1 << 0 ) @@ -894,7 +896,7 @@ // { // printf( "OSD:%d:%s\n", index, ty_OSD1.text[ index ] ); // } - vo.sub = &ty_OSD1; + vo_data->sub = &ty_OSD1; vo_osd_changed( OSDTYPE_SUBTITLE ); tyOSDUpdate = 0; } Modified: mplayerxp/libvo/sub.c =================================================================== --- mplayerxp/libvo/sub.c 2012-10-23 06:54:26 UTC (rev 191) +++ mplayerxp/libvo/sub.c 2012-10-24 13:00:34 UTC (rev 192) @@ -67,9 +67,9 @@ } // renders the buffer -inline static void vo_draw_text_from_buffer(unsigned idx,mp_osd_obj_t* obj,draw_osd_f draw_alpha){ +static void vo_draw_text_from_buffer(any_t*vo,unsigned idx,mp_osd_obj_t* obj,draw_osd_f draw_alpha){ if (obj->allocated > 0) { - draw_alpha(idx, + draw_alpha(vo,idx, obj->bbox.x1,obj->bbox.y1, obj->bbox.x2-obj->bbox.x1, obj->bbox.y2-obj->bbox.y1, @@ -83,11 +83,13 @@ static void vo_update_nav (mp_osd_obj_t *obj, int dxs, int dys) { int len; + UNUSED(dxs); + UNUSED(dys); obj->bbox.x1 = obj->x = nav_hl.sx; obj->bbox.y1 = obj->y = nav_hl.sy; obj->bbox.x2 = nav_hl.ex; obj->bbox.y2 = nav_hl.ey; - + alloc_buf (obj); len = obj->stride * (obj->bbox.y2 - obj->bbox.y1); memset (obj->bitmap_buffer, OSD_NAV_BOX_ALPHA, len); @@ -98,55 +100,59 @@ } // return the real height of a char: -static inline int __FASTCALL__ get_height(int c,int h){ +inline static int __FASTCALL__ get_height(vo_data_t*vo,int c,int h){ int font; - if ((font=vo.font->font[c])>=0) - if(h<vo.font->pic_a[font]->h) h=vo.font->pic_a[font]->h; + if ((font=vo->font->font[c])>=0) + if(h<vo->font->pic_a[font]->h) h=vo->font->pic_a[font]->h; return h; } -int __FASTCALL__ get_osd_height(int c,int h) +int __FASTCALL__ get_osd_height(any_t*v,int c,int h) { - return vo.font?get_height(c,h):0; + vo_data_t* vo=(vo_data_t*)v; + return vo->font?get_height(vo,c,h):0; } -inline static void __FASTCALL__ vo_update_text_osd(mp_osd_obj_t* obj,int dxs,int dys){ - unsigned char *cp=(unsigned char *)vo.osd_text; - int x=20; - int h=0; - UNUSED(dxs); - UNUSED(dys); - obj->bbox.x1=obj->x=x; - obj->bbox.y1=obj->y=10; +static void __FASTCALL__ vo_update_text_osd(any_t*v,mp_osd_obj_t* obj,int dxs,int dys){ + vo_data_t* vo=(vo_data_t*)v; + unsigned char *cp=(unsigned char *)vo->osd_text; + int x=20; + int h=0; - while (*cp){ - int c=*cp++; - x+=vo.font->width[c]+vo.font->charspace; - h=get_height(c,h); - } - - obj->bbox.x2=x-vo.font->charspace; - obj->bbox.y2=obj->bbox.y1+h; - obj->flags|=OSDFLAG_BBOX; + UNUSED(dxs); + UNUSED(dys); + obj->bbox.x1=obj->x=x; + obj->bbox.y1=obj->y=10; + while (*cp){ + int c=*cp++; + x+=vo->font->width[c]+vo->font->charspace; + h=get_height(vo,c,h); + } + + obj->bbox.x2=x-vo->font->charspace; + obj->bbox.y2=obj->bbox.y1+h; + obj->flags|=OSDFLAG_BBOX; + } -inline static void __FASTCALL__ vo_draw_text_osd(unsigned idx,mp_osd_obj_t* obj,draw_osd_f draw_alpha){ - unsigned char *cp=(unsigned char *)vo.osd_text; - int font; - int x=obj->x; +static void __FASTCALL__ vo_draw_text_osd(any_t*v,unsigned idx,mp_osd_obj_t* obj,draw_osd_f draw_alpha){ + vo_data_t* vo=(vo_data_t*)v; + unsigned char *cp=(unsigned char *)vo->osd_text; + int font; + int x=obj->x; while (*cp){ int c=*cp++; - if ((font=vo.font->font[c])>=0 && c != ' ') - draw_alpha( idx, + if ((font=vo->font->font[c])>=0 && c != ' ') + draw_alpha(vo, idx, x,obj->y, - vo.font->width[c], - vo.font->pic_a[font]->h, - vo.font->pic_b[font]->bmp+vo.font->start[c], - vo.font->pic_a[font]->bmp+vo.font->start[c], - vo.font->pic_a[font]->w); - x+=vo.font->width[c]+vo.font->charspace; + vo->font->width[c], + vo->font->pic_a[font]->h, + vo->font->pic_b[font]->bmp+vo->font->start[c], + vo->font->pic_a[font]->bmp+vo->font->start[c], + vo->font->pic_a[font]->w); + x+=vo->font->width[c]+vo->font->charspace; } } @@ -158,113 +164,114 @@ // // the above schema is rescalled to n=elems bars -inline static void __FASTCALL__ vo_update_text_progbar(mp_osd_obj_t* obj,int dxs,int dys){ - +static void __FASTCALL__ vo_update_text_progbar(any_t*v,mp_osd_obj_t* obj,int dxs,int dys){ + vo_data_t* vo=(vo_data_t*)v; obj->flags|=OSDFLAG_CHANGED|OSDFLAG_VISIBLE; - if(vo.osd_progbar_type<0 || !vo.font){ + if(vo->osd_progbar_type<0 || !vo->font){ obj->flags&=~OSDFLAG_VISIBLE; return; } { int h=0; - int y=(dys-vo.font->height)/2; - int delimw=vo.font->width[OSD_PB_START] - +vo.font->width[OSD_PB_END] - +vo.font->charspace; + int y=(dys-vo->font->height)/2; + int delimw=vo->font->width[OSD_PB_START] + +vo->font->width[OSD_PB_END] + +vo->font->charspace; int width=(2*dxs-3*delimw)/3; - int charw=vo.font->width[OSD_PB_0]+vo.font->charspace; + int charw=vo->font->width[OSD_PB_0]+vo->font->charspace; int elems=width/charw; int x=(dxs-elems*charw-delimw)/2; - h=get_height(OSD_PB_START,h); - h=get_height(OSD_PB_END,h); - h=get_height(OSD_PB_0,h); - h=get_height(OSD_PB_1,h); + h=get_height(vo,OSD_PB_START,h); + h=get_height(vo,OSD_PB_END,h); + h=get_height(vo,OSD_PB_0,h); + h=get_height(vo,OSD_PB_1,h); obj->bbox.x1=obj->x=x; obj->bbox.y1=obj->y=y; obj->bbox.x2=x+width+delimw; - obj->bbox.y2=y+h; //vo.font->height; + obj->bbox.y2=y+h; //vo->font->height; obj->flags|=OSDFLAG_BBOX; obj->params.progbar.elems=elems; } } -inline static void __FASTCALL__ vo_draw_text_progbar(unsigned idx,mp_osd_obj_t* obj,draw_osd_f draw_alpha){ - unsigned char *s; - unsigned char *sa; - int i,w,h,st,mark; - int x=obj->x; - int y=obj->y; - int c,font; - int charw=vo.font->width[OSD_PB_0]+vo.font->charspace; - int elems=obj->params.progbar.elems; +static void __FASTCALL__ vo_draw_text_progbar(any_t*v,unsigned idx,mp_osd_obj_t* obj,draw_osd_f draw_alpha){ + vo_data_t* vo=(vo_data_t*)v; + unsigned char *s; + unsigned char *sa; + int i,w,h,st,mark; + int x=obj->x; + int y=obj->y; + int c,font; + int charw=vo->font->width[OSD_PB_0]+vo->font->charspace; + int elems=obj->params.progbar.elems; - if (vo.osd_progbar_value<=0) + if (vo->osd_progbar_value<=0) mark=0; else { - int ev=vo.osd_progbar_value*elems; + int ev=vo->osd_progbar_value*elems; mark=ev>>8; if (ev & 0xFF) mark++; if (mark>elems) mark=elems; } - c=vo.osd_progbar_type; - if(vo.osd_progbar_type>0 && (font=vo.font->font[c])>=0) { - int xp=x-vo.font->width[c]-vo.font->spacewidth; - draw_alpha(idx,(xp<0?0:xp),y, - vo.font->width[c], - vo.font->pic_a[font]->h, - vo.font->pic_b[font]->bmp+vo.font->start[c], - vo.font->pic_a[font]->bmp+vo.font->start[c], - vo.font->pic_a[font]->w); + c=vo->osd_progbar_type; + if(vo->osd_progbar_type>0 && (font=vo->font->font[c])>=0) { + int xp=x-vo->font->width[c]-vo->font->spacewidth; + draw_alpha(vo,idx,(xp<0?0:xp),y, + vo->font->width[c], + vo->font->pic_a[font]->h, + vo->font->pic_b[font]->bmp+vo->font->start[c], + vo->font->pic_a[font]->bmp+vo->font->start[c], + vo->font->pic_a[font]->w); } c=OSD_PB_START; - if ((font=vo.font->font[c])>=0) - draw_alpha(idx,x,y, - vo.font->width[c], - vo.font->pic_a[font]->h, - vo.font->pic_b[font]->bmp+vo.font->start[c], - vo.font->pic_a[font]->bmp+vo.font->start[c], - vo.font->pic_a[font]->w); - x+=vo.font->width[c]+vo.font->charspace; + if ((font=vo->font->font[c])>=0) + draw_alpha(vo,idx,x,y, + vo->font->width[c], + vo->font->pic_a[font]->h, + vo->font->pic_b[font]->bmp+vo->font->start[c], + vo->font->pic_a[font]->bmp+vo->font->start[c], + vo->font->pic_a[font]->w); + x+=vo->font->width[c]+vo->font->charspace; c=OSD_PB_0; - if ((font=vo.font->font[c])>=0){ - w=vo.font->width[c]; - h=vo.font->pic_a[font]->h; - s=vo.font->pic_b[font]->bmp+vo.font->start[c]; - sa=vo.font->pic_a[font]->bmp+vo.font->start[c]; - st=vo.font->pic_a[font]->w; + if ((font=vo->font->font[c])>=0){ + w=vo->font->width[c]; + h=vo->font->pic_a[font]->h; + s=vo->font->pic_b[font]->bmp+vo->font->start[c]; + sa=vo->font->pic_a[font]->bmp+vo->font->start[c]; + st=vo->font->pic_a[font]->w; if ((i=mark)) do { - draw_alpha(idx,x,y,w,h,s,sa,st); + draw_alpha(vo,idx,x,y,w,h,s,sa,st); x+=charw; } while(--i); } c=OSD_PB_1; - if ((font=vo.font->font[c])>=0){ - w=vo.font->width[c]; - h=vo.font->pic_a[font]->h; - s =vo.font->pic_b[font]->bmp+vo.font->start[c]; - sa=vo.font->pic_a[font]->bmp+vo.font->start[c]; - st=vo.font->pic_a[font]->w; + if ((font=vo->font->font[c])>=0){ + w=vo->font->width[c]; + h=vo->font->pic_a[font]->h; + s =vo->font->pic_b[font]->bmp+vo->font->start[c]; + sa=vo->font->pic_a[font]->bmp+vo->font->start[c]; + st=vo->font->pic_a[font]->w; if ((i=elems-mark)) do { - draw_alpha(idx,x,y,w,h,s,sa,st); + draw_alpha(vo,idx,x,y,w,h,s,sa,st); x+=charw; } while(--i); } c=OSD_PB_END; - if ((font=vo.font->font[c])>=0) - draw_alpha(idx,x,y, - vo.font->width[c], - vo.font->pic_a[font]->h, - vo.font->pic_b[font]->bmp+vo.font->start[c], - vo.font->pic_a[font]->bmp+vo.font->start[c], - vo.font->pic_a[font]->w); -// x+=vo.font->width[c]+vo.font->charspace; + if ((font=vo->font->font[c])>=0) + draw_alpha(vo,idx,x,y, + vo->font->width[c], + vo->font->pic_a[font]->h, + vo->font->pic_b[font]->bmp+vo->font->start[c], + vo->font->pic_a[font]->bmp+vo->font->start[c], + vo->font->pic_a[font]->w); +// x+=vo->font->width[c]+vo->font->charspace; // vo_osd_progbar_value=(vo_osd_progbar_value+1)&0xFF; @@ -273,19 +280,20 @@ // vo_draw_text_sub(int dxs,int dys,void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride)) -inline static void __FASTCALL__ vo_update_text_sub(mp_osd_obj_t* obj,int dxs,int dys){ - unsigned char *t; - int c,i,j,l,font; - int len; - int k,lastk=0; - int lastStripPosition; - int xsize,lastxsize=0; - int xmin=dxs,xmax=0; - int h,lasth; +static void __FASTCALL__ vo_update_text_sub(any_t*v,mp_osd_obj_t* obj,int dxs,int dys){ + vo_data_t* vo=(vo_data_t*)v; + unsigned char *t; + int c,i,j,l,font; + int len; + int k,lastk=0; + int lastStripPosition; + int xsize,lastxsize=0; + int xmin=dxs,xmax=0; + int h,lasth; obj->flags|=OSDFLAG_CHANGED|OSDFLAG_VISIBLE; - if(!vo.sub || !vo.font){ + if(!vo->sub || !vo->font){ obj->flags&=~OSDFLAG_VISIBLE; return; } @@ -295,14 +303,14 @@ // too long lines divide into a smaller ones i=k=lasth=0; - h=vo.font->height; - xsize=-vo.font->charspace; + h=vo->font->height; + xsize=-vo->font->charspace; lastStripPosition=-1; - l=vo.sub->lines; + l=vo->sub->lines; while (l) { l--; - t=vo.sub->text[i++]; + t=vo->sub->text[i++]; len=strlen(t)-1; for (j=0;j<=len;j++){ @@ -325,27 +333,27 @@ lastk=k; lastStripPosition=j; lastxsize=xsize; - } else if ((font=vo.font->font[c])>=0){ - if (vo.font->pic_a[font]->h > h){ - h=vo.font->pic_a[font]->h; + } else if ((font=vo->font->font[c])>=0){ + if (vo->font->pic_a[font]->h > h){ + h=vo->font->pic_a[font]->h; } } obj->params.subtitle.utbl[k++]=c; - xsize+=vo.font->width[c]+vo.font->charspace; + xsize+=vo->font->width[c]+vo->font->charspace; if (dxs<xsize){ if (lastStripPosition>0){ j=lastStripPosition; xsize=lastxsize; k=lastk; } else { - xsize -=vo.font->width[c]+vo.font->charspace; // go back + xsize -=vo->font->width[c]+vo->font->charspace; // go back k--; // cut line here while (t[j] && t[j]!=' ') j++; // jump to the nearest space } } else if (j<len) continue; if (h>obj->y){ // out of the screen so end parsing - obj->y -= lasth - vo.font->height; // correct the y position + obj->y -= lasth - vo->font->height; // correct the y position l=0; break; } @@ -357,11 +365,11 @@ l=0; len=j; // end parsing } else if(l || j<len){ // not the last line or not the last char lastStripPosition=-1; - xsize=-vo.font->charspace; + xsize=-vo->font->charspace; lasth=h; - h=vo.font->height; + h=vo->font->height; } - obj->y -=h; // according to max of vo.font->pic_a[font]->h + obj->y -=h; // according to max of vo->font->pic_a[font]->h } } @@ -375,30 +383,31 @@ obj->bbox.x1=xmin; obj->bbox.x2=xmax; obj->bbox.y1=obj->y; -// obj->bbox.y2=obj->y+obj->params.subtitle.lines*vo.font->height; +// obj->bbox.y2=obj->y+obj->params.subtitle.lines*vo->font->height; obj->flags|=OSDFLAG_BBOX; } -inline static void __FASTCALL__ vo_draw_text_sub(unsigned idx,mp_osd_obj_t* obj,draw_osd_f draw_alpha){ - int i,j,c,x,l,font; - int y=obj->y; +static void __FASTCALL__ vo_draw_text_sub(any_t*v,unsigned idx,mp_osd_obj_t* obj,draw_osd_f draw_alpha){ + vo_data_t* vo=(vo_data_t*)v; + int i,j,c,x,l,font; + int y=obj->y; i=j=0; if ((l=obj->params.subtitle.lines)) for (;;) { x=obj->params.subtitle.xtbl[i++]; while ((c=obj->params.subtitle.utbl[j++])){ - if ((font=vo.font->font[c])>=0) - draw_alpha(idx,x,y, - vo.font->width[c], - vo.font->pic_a[font]->h+y<obj->dys ? vo.font->pic_a[font]->h : obj->dys-y, - vo.font->pic_b[font]->bmp+vo.font->start[c], - vo.font->pic_a[font]->bmp+vo.font->start[c], - vo.font->pic_a[font]->w); - x+=vo.font->width[c]+vo.font->charspace; + if ((font=vo->font->font[c])>=0) + draw_alpha(vo,idx,x,y, + vo->font->width[c], + vo->font->pic_a[font]->h+y<obj->dys ? vo->font->pic_a[font]->h : obj->dys-y, + vo->font->pic_b[font]->bmp+vo->font->start[c], + vo->font->pic_a[font]->bmp+vo->font->start[c], + vo->font->pic_a[font]->w); + x+=vo->font->width[c]+vo->font->charspace; } if (!--l) break; - y+=vo.font->height; + y+=vo->font->height; } } @@ -421,7 +430,8 @@ vo_osd_list=NULL; } -int __FASTCALL__ vo_update_osd(int dxs,int dys){ +int __FASTCALL__ vo_update_osd(any_t*v,int dxs,int dys){ + vo_data_t* vo=(vo_data_t*)v; mp_osd_obj_t* obj=vo_osd_list; int chg=0; while(obj){ @@ -430,29 +440,29 @@ obj->flags&=~OSDFLAG_BBOX; switch(obj->type){ case OSDTYPE_SUBTITLE: - vo_update_text_sub(obj,dxs,dys); + vo_update_text_sub(vo,obj,dxs,dys); break; case OSDTYPE_PROGBAR: - vo_update_text_progbar(obj,dxs,dys); + vo_update_text_progbar(vo,obj,dxs,dys); break; case OSDTYPE_DVDNAV: vo_update_nav(obj,dxs,dys); break; case OSDTYPE_SPU: - if(vo.spudec && spudec_visible(vo.spudec)) + if(vo->spudec && spudec_visible(vo->spudec)) obj->flags|=OSDFLAG_VISIBLE|OSDFLAG_CHANGED; else obj->flags&=~OSDFLAG_VISIBLE; break; case OSDTYPE_VOBSUB: - if(vo.vobsub) + if(vo->vobsub) obj->flags|=OSDFLAG_VISIBLE|OSDFLAG_CHANGED; else obj->flags&=~OSDFLAG_VISIBLE; break; case OSDTYPE_OSD: - if(vo.font && vo.osd_text && vo.osd_text[0]){ - vo_update_text_osd(obj,dxs,dys); // update bbox + if(vo->font && vo->osd_text && vo->osd_text[0]){ + vo_update_text_osd(vo,obj,dxs,dys); // update bbox obj->flags|=OSDFLAG_VISIBLE|OSDFLAG_CHANGED; } else obj->flags&=~OSDFLAG_VISIBLE; @@ -485,7 +495,7 @@ } if(obj->flags&OSDFLAG_CHANGED){ chg|=1<<obj->type; - MSG_DBG2("OSD chg: %d V: %s pb:%d \n",obj->type,(obj->flags&OSDFLAG_VISIBLE)?"yes":"no",vo.osd_progbar_type); + MSG_DBG2("OSD chg: %d V: %s pb:%d \n",obj->type,(obj->flags&OSDFLAG_VISIBLE)?"yes":"no",vo->osd_progbar_type); } obj=obj->next; } @@ -507,18 +517,19 @@ new_osd_obj(OSDTYPE_DVDNAV); } -void __FASTCALL__ vo_remove_text(unsigned idx,int dxs,int dys,clear_osd_f f_remove){ +void __FASTCALL__ vo_remove_text(any_t*v,unsigned idx,int dxs,int dys,clear_osd_f f_remove){ + vo_data_t* vo=(vo_data_t*)v; mp_osd_obj_t* obj=vo_osd_list; - vo_update_osd(dxs,dys); + vo_update_osd(v,dxs,dys); while(obj){ - if(((obj->flags&OSDFLAG_CHANGED) || (obj->flags&OSDFLAG_VISIBLE) || - (obj->cleared_frames>=0)) && + if(((obj->flags&OSDFLAG_CHANGED) || (obj->flags&OSDFLAG_VISIBLE) || + (obj->cleared_frames>=0)) && (obj->flags&OSDFLAG_OLD_BBOX)){ int w=obj->old_bbox.x2-obj->old_bbox.x1; int h=obj->old_bbox.y2-obj->old_bbox.y1; if(w>0 && h>0){ - vo.osd_changed_flag=obj->flags&OSDFLAG_CHANGED; // temp hack - f_remove(idx,obj->old_bbox.x1,obj->old_bbox.y1,w,h); + vo->osd_changed_flag=obj->flags&OSDFLAG_CHANGED; // temp hack + f_remove(vo,idx,obj->old_bbox.x1,obj->old_bbox.y1,w,h); } // obj->flags&=~OSDFLAG_OLD_BBOX; if(obj->cleared_frames>=0) { @@ -531,36 +542,39 @@ } } -void __FASTCALL__ vo_draw_spudec(unsigned idx,int dxs,int dys,draw_osd_f draw_alpha){ - spudec_draw_scaled(vo.spudec, dxs, dys, draw_alpha); // FIXME +void __FASTCALL__ vo_draw_spudec(any_t*v,unsigned idx,int dxs,int dys,draw_osd_f draw_alpha){ + UNUSED(idx); + vo_data_t*vo=(vo_data_t*)v; + spudec_draw_scaled(vo->spudec, dxs, dys, draw_alpha,v); // FIXME } -void __FASTCALL__ vo_draw_text(unsigned idx,int dxs,int dys,draw_osd_f draw_alpha){ +void __FASTCALL__ vo_draw_text(any_t*v,unsigned idx,int dxs,int dys,draw_osd_f draw_alpha){ + vo_data_t* vo=(vo_data_t*)v; mp_osd_obj_t* obj=vo_osd_list; - vo_update_osd(dxs,dys); + vo_update_osd(v,dxs,dys); while(obj){ if(obj->flags&OSDFLAG_VISIBLE){ obj->cleared_frames=0; - vo.osd_changed_flag=obj->flags&OSDFLAG_CHANGED; // temp hack + vo->osd_changed_flag=obj->flags&OSDFLAG_CHANGED; // temp hack switch(obj->type){ case OSDTYPE_SPU: - spudec_draw_scaled(vo.spudec, dxs, dys, draw_alpha); // FIXME + spudec_draw_scaled(vo->spudec, dxs, dys, draw_alpha,v); // FIXME break; case OSDTYPE_VOBSUB: - if(vo.spudec) spudec_draw_scaled(vo.spudec, dxs, dys, draw_alpha); // FIXME + if(vo->spudec) spudec_draw_scaled(vo->spudec, dxs, dys, draw_alpha,v); // FIXME break; case OSDTYPE_OSD: - vo_draw_text_osd(idx,obj,draw_alpha); + vo_draw_text_osd(vo,idx,obj,draw_alpha); break; case OSDTYPE_SUBTITLE: - vo_draw_text_sub(idx,obj,draw_alpha); + vo_draw_text_sub(vo,idx,obj,draw_alpha); break; case OSDTYPE_PROGBAR: - vo_draw_text_progbar(idx,obj,draw_alpha); + vo_draw_text_progbar(vo,idx,obj,draw_alpha); break; case OSDTYPE_DVDNAV: - vo_draw_text_from_buffer(idx,obj,draw_alpha); + vo_draw_text_from_buffer(vo,idx,obj,draw_alpha); break; } obj->old_bbox=obj->bbox; Modified: mplayerxp/libvo/sub.h =================================================================== --- mplayerxp/libvo/sub.h 2012-10-23 06:54:26 UTC (rev 191) +++ mplayerxp/libvo/sub.h 2012-10-24 13:00:34 UTC (rev 192) @@ -88,19 +88,19 @@ }sub_data_t; extern sub_data_t sub_data; -typedef void (* __FASTCALL__ draw_osd_f)(unsigned idx,int x0,int y0, int w,int h,const unsigned char* src,const unsigned char *srca, int stride); -typedef void (* __FASTCALL__ clear_osd_f)(unsigned idx,int x0,int y0, int w,int h); +typedef void (* __FASTCALL__ draw_osd_f)(any_t*vo,unsigned idx,int x0,int y0, int w,int h,const unsigned char* src,const unsigned char *srca, int stride); +typedef void (* __FASTCALL__ clear_osd_f)(any_t*vo,unsigned idx,int x0,int y0, int w,int h); /* for direct calll from XP-thread*/ -extern void __FASTCALL__ vo_draw_spudec(unsigned idx,int dxs,int dys,draw_osd_f draw_alpha); +extern void __FASTCALL__ vo_draw_spudec(any_t*vo,unsigned idx,int dxs,int dys,draw_osd_f draw_alpha); -extern void __FASTCALL__ vo_draw_text(unsigned idx,int dxs,int dys, draw_osd_f draw_alpha); -extern void __FASTCALL__ vo_remove_text(unsigned idx,int dxs,int dys,clear_osd_f remove); +extern void __FASTCALL__ vo_draw_text(any_t*vo,unsigned idx,int dxs,int dys, draw_osd_f draw_alpha); +extern void __FASTCALL__ vo_remove_text(any_t*vo,unsigned idx,int dxs,int dys,clear_osd_f remove); void vo_init_osd(void); -int __FASTCALL__ vo_update_osd(int dxs,int dys); +int __FASTCALL__ vo_update_osd(any_t*vo,int dxs,int dys); int __FASTCALL__ vo_osd_changed(int new_value); -int __FASTCALL__ get_osd_height(int c,int h); +int __FASTCALL__ get_osd_height(any_t* vo,int c,int h); void __FASTCALL__ osd_set_nav_box (uint16_t sx, uint16_t sy, uint16_t ex, uint16_t ey); #endif Modified: mplayerxp/libvo/video_out.c =================================================================== --- mplayerxp/libvo/video_out.c 2012-10-23 06:54:26 UTC (rev 191) +++ mplayerxp/libvo/video_out.c 2012-10-24 13:00:34 UTC (rev 192) @@ -43,8 +43,7 @@ #include "sub.h" #include "vo_msg.h" -vo_priv_t vo; -static vo_format_desc vod; +vo_conf_t vo_conf; // // Externally visible list of all vo drivers @@ -127,37 +126,37 @@ uint32_t d_width,d_height; unsigned off[4]; /* offsets for y,u,v if DR on non fully fitted surface */ }dri_priv_t; -static dri_priv_t dri; -typedef struct vo_priv_data_s { +typedef struct vo_priv_s { uint32_t srcFourcc,image_format,image_width,image_height; uint32_t org_width,org_height; unsigned ps_off[4]; /* offsets for y,u,v in panscan mode */ unsigned long long int frame_counter; pthread_mutex_t surfaces_mutex; -}vo_priv_data_t; -static vo_priv_data_t vo_data; + vo_format_desc vod; + dri_priv_t dri; +}vo_priv_t; -void vo_print_help( void ) +void vo_print_help(vo_data_t*vo) { unsigned i; MSG_INFO("Available video output drivers:\n"); i=0; while (video_out_drivers[i]) { - const vo_info_t *info = video_out_drivers[i++]->get_info (); + const vo_info_t *info = video_out_drivers[i++]->get_info (vo); MSG_INFO("\t%s\t%s\n", info->short_name, info->name); } MSG_INFO("\n"); } -const vo_functions_t *vo_register(const char *driver_name) +const vo_functions_t *vo_register(vo_data_t*vo,const char *driver_name) { unsigned i; if(!driver_name) video_out=video_out_drivers[0]; else for (i=0; video_out_drivers[i] != NULL; i++){ - const vo_info_t *info = video_out_drivers[i]->get_info (); + const vo_info_t *info = video_out_drivers[i]->get_info (vo); if(strcmp(info->short_name,driver_name) == 0){ video_out = video_out_drivers[i];break; } @@ -165,34 +164,43 @@ return video_out; } -const vo_info_t* vo_get_info( void ) +const vo_info_t* vo_get_info(vo_data_t*vo) { - return video_out->get_info(); + return video_out->get_info(vo); } -void __FASTCALL__ vo_preinit_structs( void ) +vo_data_t* __FASTCALL__ vo_preinit_structs( void ) { + vo_data_t* vo; pthread_mutexattr_t attr; - memset(&dri,0,sizeof(dri_priv_t)); - dri.num_xp_frames=1; - memset(&vo,0,sizeof(vo_priv_t)); - vo.movie_aspect=-1.0; - vo.flip=-1; - vo.da_buffs=64; - vo.window = None; - vo.WinID=-1; - vo.osd_progbar_type=-1; - vo.osd_progbar_value=100; // 0..256 - memset(&vo_data,0,sizeof(vo_priv_data_t)); + + memset(&vo_conf,0,sizeof(vo_conf_t)); + vo_conf.movie_aspect=-1.0; + vo_conf.flip=-1; + vo_conf.da_buffs=64; + vo_conf.WinID=-1; + + vo=malloc(sizeof(vo_data_t)); + memset(vo,0,sizeof(vo_data_t)); + vo->window = None; + vo->osd_progbar_type=-1; + vo->osd_progbar_value=100; // 0..256 + + vo->vo_priv=malloc(sizeof(vo_priv_t)); + memset(vo->vo_priv,0,sizeof(vo_priv_t)); + vo_priv_t* priv=(vo_priv_t*)vo->vo_priv; pthread_mutexattr_init(&attr); - pthread_mutex_init(&vo_data.surfaces_mutex,&attr); + pthread_mutex_init(&priv->surfaces_mutex,&attr); + priv->dri.num_xp_frames=1; + return vo; } -int __FASTCALL__ vo_init(const char *subdevice) +int __FASTCALL__ vo_init(vo_data_t*vo,const char *subdevice) { + vo_priv_t* priv=(vo_priv_t*)vo->vo_priv; MSG_DBG3("dri_vo_dbg: vo_init(%s)\n",subdevice); - vo_data.frame_counter=0; - return video_out->preinit(subdevice); + priv->frame_counter=0; + return video_out->preinit(vo,subdevice); } int __FASTCALL__ vo_describe_fourcc(uint32_t fourcc,vo_format_desc *vd) @@ -260,137 +268,142 @@ return is_planar; } -static void __FASTCALL__ dri_config(uint32_t fourcc) +static void __FASTCALL__ dri_config(vo_data_t*vo,uint32_t fourcc) { + vo_priv_t* priv=(vo_priv_t*)vo->vo_priv; unsigned i; - dri.is_planar = vo_describe_fourcc(fourcc,&vod); - dri.bpp=vod.bpp; - if(!dri.bpp) dri.has_dri=0; /*unknown fourcc*/ - if(dri.has_dri) + priv->dri.is_planar = vo_describe_fourcc(fourcc,&priv->vod); + priv->dri.bpp=priv->vod.bpp; + if(!priv->dri.bpp) priv->dri.has_dri=0; /*unknown fourcc*/ + if(priv->dri.has_dri) { - video_out->control(VOCTRL_GET_NUM_FRAMES,&dri.num_xp_frames); - dri.num_xp_frames=min(dri.num_xp_frames,MAX_DRI_BUFFERS); - for(i=0;i<dri.num_xp_frames;i++) + video_out->control(vo,VOCTRL_GET_NUM_FRAMES,&priv->dri.num_xp_frames); + priv->dri.num_xp_frames=min(priv->dri.num_xp_frames,MAX_DRI_BUFFERS); + for(i=0;i<priv->dri.num_xp_frames;i++) { - dri.surf[i].idx=i; - video_out->control(DRI_GET_SURFACE,&... [truncated message content] |