From 1f4c177f0b90bce5c8dc805c323b43b38c33fb20 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Tue, 28 Jan 2003 16:52:36 +0000 Subject: [PATCH] * ./modules/visualization/xosd/xosd.c: fixed compilation with version 2 of libxosd. --- configure.ac.in | 10 +++++++--- modules/visualization/xosd/xosd.c | 11 +++++++++-- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/configure.ac.in b/configure.ac.in index 06eca9efdf..8065d1eb29 100644 --- a/configure.ac.in +++ b/configure.ac.in @@ -2497,9 +2497,13 @@ AC_ARG_ENABLE(xosd, if test "x${enable_xosd}" = "xyes" then AC_CHECK_HEADER(xosd.h, have_xosd="true", have_xosd="false") - AC_TRY_COMPILE([#include ], - [void foo() { xosd_init("foo","bar",12,XOSD_top,2,12,42); }],, - AC_DEFINE(HAVE_OLD_XOSD_H, 1, Define if is pre-1.0.0)) + AC_CHECK_LIB(xosd,xosd_set_offset, + AC_DEFINE(HAVE_XOSD_VERSION_1, 1, Define if is 1.0.x), + AC_CHECK_LIB(xosd,xosd_set_horizontal_offset, + AC_DEFINE(HAVE_XOSD_VERSION_2, 1, Define if is 2.0.x), + AC_TRY_COMPILE([#include ], + [void foo() { xosd_init("foo","bar",12,XOSD_top,2,12,42); }],, + AC_DEFINE(HAVE_XOSD_VERSION_0, 1, Define if is pre-1.0.0)))) if test "x${have_xosd}" = "xtrue" then PLUGINS="${PLUGINS} xosd" diff --git a/modules/visualization/xosd/xosd.c b/modules/visualization/xosd/xosd.c index e40f91ad3f..dbfac88314 100644 --- a/modules/visualization/xosd/xosd.c +++ b/modules/visualization/xosd/xosd.c @@ -2,7 +2,7 @@ * xosd.c : X On Screen Display interface ***************************************************************************** * Copyright (C) 2001 VideoLAN - * $Id: xosd.c,v 1.5 2003/01/22 19:37:50 lool Exp $ + * $Id: xosd.c,v 1.6 2003/01/28 16:52:36 sam Exp $ * * Authors: Loïc Minier * @@ -108,7 +108,7 @@ static int Open( vlc_object_t *p_this ) /* Initialize library */ p_intf->p_sys->p_osd = -#ifdef HAVE_OLD_XOSD_H +#ifdef HAVE_XOSD_VERSION_0 xosd_init( config_GetPsz( p_intf, "xosd-font" ), "LawnGreen", 3, XOSD_top, 0, 1 ); #else @@ -190,8 +190,15 @@ static void Run( intf_thread_t *p_intf ) /* Set user preferences */ xosd_set_font( p_intf->p_sys->p_osd, config_GetPsz( p_intf, "xosd-font" ) ); +#ifdef HAVE_XOSD_VERSION_2 + xosd_set_horizontal_offset( p_intf->p_sys->p_osd, + config_GetInt( p_intf, "xosd-text-offset" ) ); + xosd_set_vertical_offset( p_intf->p_sys->p_osd, + config_GetInt( p_intf, "xosd-text-offset" ) ); +#else xosd_set_offset( p_intf->p_sys->p_osd, config_GetInt( p_intf, "xosd-text-offset" ) ); +#endif xosd_set_shadow_offset( p_intf->p_sys->p_osd, config_GetInt( p_intf, "xosd-shadow-offset" )); xosd_set_pos( p_intf->p_sys->p_osd, -- 2.20.1