[MPlayer-cvslog] r21216 - in trunk: libvo/sub.c mplayer.c stream/stream_dvdnav.c stream/stream_dvdnav.h

ben subversion at mplayerhq.hu
Sat Nov 25 14:03:52 CET 2006


Author: ben
Date: Sat Nov 25 14:03:51 2006
New Revision: 21216

Modified:
   trunk/libvo/sub.c
   trunk/mplayer.c
   trunk/stream/stream_dvdnav.c
   trunk/stream/stream_dvdnav.h

Log:
better nav highlight handling

Modified: trunk/libvo/sub.c
==============================================================================
--- trunk/libvo/sub.c	(original)
+++ trunk/libvo/sub.c	Sat Nov 25 14:03:51 2006
@@ -9,7 +9,8 @@
 #endif
 
 #ifdef USE_DVDNAV
-#include <dvdnav.h>
+#include "stream/stream.h"
+#include "stream/stream_dvdnav.h"
 #define OSD_NAV_BOX_ALPHA 0x7f
 #endif
 
@@ -199,13 +200,14 @@
 
 #ifdef USE_DVDNAV
 inline static void vo_update_nav (mp_osd_obj_t *obj, int dxs, int dys) {
-  extern dvdnav_highlight_event_t dvd_nav_hl;
+  nav_highlight_t hl;
   int len;
 
-  obj->bbox.x1 = obj->x = dvd_nav_hl.sx;
-  obj->bbox.y1 = obj->y = dvd_nav_hl.sy;
-  obj->bbox.x2 = dvd_nav_hl.ex;
-  obj->bbox.y2 = dvd_nav_hl.ey;
+  mp_dvdnav_get_highlight (&hl);
+  obj->bbox.x1 = obj->x = hl.sx;
+  obj->bbox.y1 = obj->y = hl.sy;
+  obj->bbox.x2 = hl.ex;
+  obj->bbox.y2 = hl.ey;
   
   alloc_buf (obj);
   len = obj->stride * (obj->bbox.y2 - obj->bbox.y1);

Modified: trunk/mplayer.c
==============================================================================
--- trunk/mplayer.c	(original)
+++ trunk/mplayer.c	Sat Nov 25 14:03:51 2006
@@ -183,6 +183,10 @@
 #include "stream/stream_dvd.h"
 #endif
 
+#ifdef USE_DVDNAV
+#include "stream/stream_dvdnav.h"
+#endif
+
 #include "libmpcodecs/dec_audio.h"
 #include "libmpcodecs/dec_video.h"
 #include "libmpcodecs/mp_image.h"
@@ -4698,9 +4702,10 @@
 
 #ifdef USE_DVDNAV
  if (stream->type == STREAMTYPE_DVDNAV) {
-   extern int dvd_nav_hl_on;
+   nav_highlight_t hl;
 
-   if (dvd_nav_hl_on)
+   mp_dvdnav_get_highlight (&hl);
+   if (hl.sx != 0 && hl.sy != 0) /* highlighting on */
      vo_osd_changed (OSDTYPE_DVDNAV);
  }
 #endif

Modified: trunk/stream/stream_dvdnav.c
==============================================================================
--- trunk/stream/stream_dvdnav.c	(original)
+++ trunk/stream/stream_dvdnav.c	Sat Nov 25 14:03:51 2006
@@ -46,8 +46,7 @@
 };
 
 int dvd_nav_still=0;            /* are we on a still picture? */
-dvdnav_highlight_event_t dvd_nav_hl;
-int dvd_nav_hl_on = 0;
+static dvdnav_highlight_event_t dvd_nav_hl;
 
 static int seek(stream_t *s, off_t newpos);
 
@@ -129,7 +128,6 @@
 
         hlev->palette = (btni->btn_coln == 0) ? 0 :
           pnavpci->hli.btn_colit.btn_coli[btni->btn_coln - 1][0];
-        dvd_nav_hl_on = 1;
         break;
       }
     }
@@ -137,7 +135,6 @@
     hlev->sx = hlev->ex = 0;
     hlev->sy = hlev->ey = 0;
     hlev->palette = hlev->buttonN = 0;
-    dvd_nav_hl_on = 0;
   }
 }
 
@@ -494,6 +491,12 @@
   return n;
 }
 
+void mp_dvdnav_get_highlight (nav_highlight_t *hl) {
+  hl->sx = dvd_nav_hl.sx;
+  hl->sy = dvd_nav_hl.sy;
+  hl->ex = dvd_nav_hl.ex;
+  hl->ey = dvd_nav_hl.ey;
+}
 
 stream_info_t stream_info_dvdnav = {
   "DVDNAV stream",

Modified: trunk/stream/stream_dvdnav.h
==============================================================================
--- trunk/stream/stream_dvdnav.h	(original)
+++ trunk/stream/stream_dvdnav.h	Sat Nov 25 14:03:51 2006
@@ -10,6 +10,11 @@
 } dvdnav_event_t;
 
 typedef struct {
+  uint16_t sx, sy;
+  uint16_t ex, ey;
+} nav_highlight_t;
+
+typedef struct {
   dvdnav_t *       dvdnav;              /* handle to libdvdnav stuff */
   char *           filename;            /* path */
   int              ignore_timers;       /* should timers be skipped? */
@@ -26,5 +31,6 @@
 int dvdnav_sid_from_lang(stream_t *stream, unsigned char *language);
 int mp_dvdnav_handle_input(stream_t *stream, int cmd, int *button);
 void mp_dvdnav_update_mouse_pos(stream_t *stream, int32_t x, int32_t y, int* button);
+void mp_dvdnav_get_highlight (nav_highlight_t *hl);
 
 #endif



More information about the MPlayer-cvslog mailing list