diff options
author | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2007-02-18 09:33:45 +0000 |
---|---|---|
committer | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2007-02-18 09:33:45 +0000 |
commit | e77a7954de2675dd41af2efcaf16dc258c8d2af4 (patch) | |
tree | 286b6f0d744a5af7ee7c1f4917ea32bd766b65f1 /libvo/vo_xvmc.c | |
parent | 6f797ffeabd3f00edc453e8cd9a90b0cde3d6b62 (diff) | |
download | mpv-e77a7954de2675dd41af2efcaf16dc258c8d2af4.tar.bz2 mpv-e77a7954de2675dd41af2efcaf16dc258c8d2af4.tar.xz |
Avoid parts of xvmc reinit when source format does not change
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22255 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo/vo_xvmc.c')
-rw-r--r-- | libvo/vo_xvmc.c | 62 |
1 files changed, 34 insertions, 28 deletions
diff --git a/libvo/vo_xvmc.c b/libvo/vo_xvmc.c index 6fc415cb24..4d40b06985 100644 --- a/libvo/vo_xvmc.c +++ b/libvo/vo_xvmc.c @@ -419,33 +419,14 @@ opt_t subopts [] = return 0; } -static int config(uint32_t width, uint32_t height, - uint32_t d_width, uint32_t d_height, - uint32_t flags, char *title, uint32_t format){ +static int init_xvmc(int width, int height, unsigned format) { int i,mode_id,rez; int numblocks,blocks_per_macroblock;//bpmb we have 6,8,12 -//from vo_xv -char *hello = (title == NULL) ? "XvMC render" : title; -XSizeHints hint; -XVisualInfo vinfo; -XGCValues xgcv; -XSetWindowAttributes xswa; -XWindowAttributes attribs; -unsigned long xswamask; -int depth; -#ifdef HAVE_XF86VM -int vm=0; -unsigned int modeline_width, modeline_height; -static uint32_t vm_width; -static uint32_t vm_height; -#endif -//end of vo_xv - if( !IMGFMT_IS_XVMC(format) ) { assert(0);//should never happen, abort on debug or - return 1;//return error on relese + return -1;//return error on relese } // Find free port that supports MC, by querying adaptors @@ -600,6 +581,38 @@ found_subpic: vo_xv_enable_vsync();//it won't break anything + /* store image dimesions for displaying */ + p_render_surface_visible = NULL; + p_render_surface_to_show = NULL; + + free_element = 0; + first_frame = 1; + return 0; +} + +static int config(uint32_t width, uint32_t height, + uint32_t d_width, uint32_t d_height, + uint32_t flags, char *title, uint32_t format){ +//from vo_xv +char *hello = (title == NULL) ? "XvMC render" : title; +XSizeHints hint; +XVisualInfo vinfo; +XGCValues xgcv; +XSetWindowAttributes xswa; +XWindowAttributes attribs; +unsigned long xswamask; +int depth; +#ifdef HAVE_XF86VM +int vm=0; +unsigned int modeline_width, modeline_height; +static uint32_t vm_width; +static uint32_t vm_height; +#endif +//end of vo_xv + + if (!(flags & VOFLAG_SAME_INPUT)) + if (init_xvmc(width, height, format) < 0) return -1; + //taken from vo_xv image_height = height; image_width = width; @@ -744,13 +757,6 @@ found_subpic: //end vo_xv - /* store image dimesions for displaying */ - p_render_surface_visible = NULL; - p_render_surface_to_show = NULL; - - free_element = 0; - first_frame = 1; - vo_directrendering = 1;//ugly hack, coz xvmc works only with direct rendering return 0; } |