diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/video_out/video_out_xcbxv.c | 10 | ||||
-rw-r--r-- | src/video_out/video_out_xv.c | 10 | ||||
-rw-r--r-- | src/video_out/xv_common.h | 3 |
3 files changed, 19 insertions, 4 deletions
diff --git a/src/video_out/video_out_xcbxv.c b/src/video_out/video_out_xcbxv.c index bb7e32946..42b841d7c 100644 --- a/src/video_out/video_out_xcbxv.c +++ b/src/video_out/video_out_xcbxv.c @@ -138,6 +138,8 @@ struct xv_driver_s { int use_colorkey; uint32_t colorkey; + int sync_is_vsync; + /* hold initial port attributes values to restore on exit */ xine_list_t *port_attributes; @@ -157,6 +159,7 @@ typedef struct { } xv_class_t; static const char *const prefer_types[] = VIDEO_DEVICE_XV_PREFER_TYPES; +static const char *const sync_atoms[] = VIDEO_DEVICE_XV_VSYNC_ATOMS; static uint32_t xv_get_capabilities (vo_driver_t *this_gen) { xv_driver_t *this = (xv_driver_t *) this_gen; @@ -1240,7 +1243,9 @@ static void xv_update_XV_DOUBLE_BUFFER(void *this_gen, xine_cfg_entry_t *entry) } static void xv_update_XV_SYNC_TO_VBLANK(void *this_gen, xine_cfg_entry_t *entry) { - xv_update_attr (this_gen, entry, "XV_SYNC_TO_VBLANK", "sync to vblank"); + xv_update_attr (this_gen, entry, + sync_atoms[((xv_driver_t *)this_gen)->sync_is_vsync], + "sync to vblank"); } static void xv_update_xv_pitch_alignment(void *this_gen, xine_cfg_entry_t *entry) { @@ -1504,7 +1509,8 @@ static vo_driver_t *open_plugin(video_driver_class_t *class_gen, const void *vis VIDEO_DEVICE_XV_DOUBLE_BUFFER_HELP, 20, xv_update_XV_DOUBLE_BUFFER, this); config->update_num(config,"video.device.xv_double_buffer",xv_double_buffer); - } else if(!strcmp(xcb_xv_attribute_info_name(attribute_it.data), "XV_SYNC_TO_VBLANK")) { + } else if(!strcmp(name, sync_atoms[this->sync_is_vsync = 0]) || + !strcmp(name, sync_atoms[this->sync_is_vsync = 1])) { int xv_sync_to_vblank; xv_sync_to_vblank = config->register_bool (config, "video.device.xv_sync_to_vblank", 1, diff --git a/src/video_out/video_out_xv.c b/src/video_out/video_out_xv.c index cc2990a03..c6f368339 100644 --- a/src/video_out/video_out_xv.c +++ b/src/video_out/video_out_xv.c @@ -143,6 +143,8 @@ struct xv_driver_s { int use_colorkey; uint32_t colorkey; + int sync_is_vsync; + /* hold initial port attributes values to restore on exit */ xine_list_t *port_attributes; @@ -170,6 +172,7 @@ typedef struct { static int gX11Fail; static const char *const prefer_types[] = VIDEO_DEVICE_XV_PREFER_TYPES; +static const char *const sync_atoms[] = VIDEO_DEVICE_XV_VSYNC_ATOMS; static uint32_t xv_get_capabilities (vo_driver_t *this_gen) { xv_driver_t *this = (xv_driver_t *) this_gen; @@ -1293,7 +1296,9 @@ static void xv_update_XV_DOUBLE_BUFFER(void *this_gen, xine_cfg_entry_t *entry) } static void xv_update_XV_SYNC_TO_VBLANK(void *this_gen, xine_cfg_entry_t *entry) { - xv_update_attr (this_gen, entry, "XV_SYNC_TO_VBLANK", "sync to vblank"); + xv_update_attr (this_gen, entry, + sync_atoms[((xv_driver_t *)this_gen)->sync_is_vsync], + "sync to vblank"); } static void xv_update_xv_pitch_alignment(void *this_gen, xine_cfg_entry_t *entry) { @@ -1562,7 +1567,8 @@ static vo_driver_t *open_plugin_2 (video_driver_class_t *class_gen, const void * VIDEO_DEVICE_XV_DOUBLE_BUFFER_HELP, 20, xv_update_XV_DOUBLE_BUFFER, this); config->update_num(config,"video.device.xv_double_buffer",xv_double_buffer); - } else if(!strcmp(attr[k].name, "XV_SYNC_TO_VBLANK")) { + } else if(((this->sync_is_vsync = 0), !strcmp(name, sync_atoms[0])) || + ((this->sync_is_vsync = 1), !strcmp(name, sync_atoms[1]))) { int xv_sync_to_vblank; xv_sync_to_vblank = config->register_bool (config, "video.device.xv_sync_to_vblank", 1, diff --git a/src/video_out/xv_common.h b/src/video_out/xv_common.h index 259afe616..df6a3f6dc 100644 --- a/src/video_out/xv_common.h +++ b/src/video_out/xv_common.h @@ -57,6 +57,9 @@ _("pitch alignment workaround"), \ _("Some buggy video drivers need a workaround to function properly.") +#define VIDEO_DEVICE_XV_VSYNC_ATOMS \ + { "XV_SYNC_TO_VBLANK", "XV_VSYNC" } + typedef enum { xv_prefer_none, xv_prefer_overlay, xv_prefer_textured } xv_prefertype; |