* ./modules/visualization/xosd/xosd.c: fixed compilation with version 2 of
authorSam Hocevar <sam@videolan.org>
Tue, 28 Jan 2003 16:52:36 +0000 (16:52 +0000)
committerSam Hocevar <sam@videolan.org>
Tue, 28 Jan 2003 16:52:36 +0000 (16:52 +0000)
    libxosd.

configure.ac.in
modules/visualization/xosd/xosd.c

index 06eca9e..8065d1e 100644 (file)
@@ -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 <xosd.h>],
-     [void foo() { xosd_init("foo","bar",12,XOSD_top,2,12,42); }],,
-      AC_DEFINE(HAVE_OLD_XOSD_H, 1, Define if <xosd.h> is pre-1.0.0))
+  AC_CHECK_LIB(xosd,xosd_set_offset,
+      AC_DEFINE(HAVE_XOSD_VERSION_1, 1, Define if <xosd.h> is 1.0.x),
+    AC_CHECK_LIB(xosd,xosd_set_horizontal_offset,
+        AC_DEFINE(HAVE_XOSD_VERSION_2, 1, Define if <xosd.h> is 2.0.x),
+      AC_TRY_COMPILE([#include <xosd.h>],
+         [void foo() { xosd_init("foo","bar",12,XOSD_top,2,12,42); }],,
+          AC_DEFINE(HAVE_XOSD_VERSION_0, 1, Define if <xosd.h> is pre-1.0.0))))
   if test "x${have_xosd}" = "xtrue"
   then
     PLUGINS="${PLUGINS} xosd"
index e40f91a..dbfac88 100644 (file)
@@ -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 <lool@videolan.org>
  *
@@ -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,