# HG changeset patch # User ben # Date 1164476662 0 # Node ID 8258747951d7df742e0785885a039c00f7d2bfe5 # Parent f9014ec912264a7646c829897f6085c75506f66f keep nav highlight event in dvdnav priv structure diff -r f9014ec91226 -r 8258747951d7 libvo/sub.c --- a/libvo/sub.c Sat Nov 25 17:31:07 2006 +0000 +++ b/libvo/sub.c Sat Nov 25 17:44:22 2006 +0000 @@ -74,6 +74,9 @@ int sub_bg_color=0; /* subtitles background color */ int sub_bg_alpha=0; int sub_justify=0; +#ifdef USE_DVDNAV +static nav_highlight_t nav_hl; +#endif // return the real height of a char: static inline int get_height(int c,int h){ @@ -199,15 +202,20 @@ } #ifdef USE_DVDNAV +void osd_set_nav_box (uint16_t sx, uint16_t sy, uint16_t ex, uint16_t ey) { + nav_hl.sx = sx; + nav_hl.sy = sy; + nav_hl.ex = ex; + nav_hl.ey = ey; +} + inline static void vo_update_nav (mp_osd_obj_t *obj, int dxs, int dys) { - nav_highlight_t hl; int len; - 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; + obj->bbox.x1 = obj->x = nav_hl.sx; + obj->bbox.y1 = obj->y = nav_hl.sy; + obj->bbox.x2 = nav_hl.ex; + obj->bbox.y2 = nav_hl.ey; alloc_buf (obj); len = obj->stride * (obj->bbox.y2 - obj->bbox.y1); diff -r f9014ec91226 -r 8258747951d7 libvo/sub.h --- a/libvo/sub.h Sat Nov 25 17:31:07 2006 +0000 +++ b/libvo/sub.h Sat Nov 25 17:44:22 2006 +0000 @@ -124,5 +124,9 @@ unsigned utf8_get_char(char **str); +#ifdef USE_DVDNAV +void osd_set_nav_box (uint16_t sx, uint16_t sy, uint16_t ex, uint16_t ey); +#endif + #endif #endif diff -r f9014ec91226 -r 8258747951d7 mplayer.c --- a/mplayer.c Sat Nov 25 17:31:07 2006 +0000 +++ b/mplayer.c Sat Nov 25 17:44:22 2006 +0000 @@ -4729,10 +4729,9 @@ #ifdef USE_DVDNAV if (stream->type == STREAMTYPE_DVDNAV) { nav_highlight_t hl; - - mp_dvdnav_get_highlight (&hl); - if (hl.sx != 0 && hl.sy != 0) /* highlighting on */ - vo_osd_changed (OSDTYPE_DVDNAV); + mp_dvdnav_get_highlight (stream, &hl); + osd_set_nav_box (hl.sx, hl.sy, hl.ex, hl.ey); + vo_osd_changed (OSDTYPE_DVDNAV); } #endif diff -r f9014ec91226 -r 8258747951d7 stream/stream_dvdnav.c --- a/stream/stream_dvdnav.c Sat Nov 25 17:31:07 2006 +0000 +++ b/stream/stream_dvdnav.c Sat Nov 25 17:44:22 2006 +0000 @@ -46,7 +46,6 @@ }; int dvd_nav_still=0; /* are we on a still picture? */ -static dvdnav_highlight_event_t dvd_nav_hl; static int seek(stream_t *s, off_t newpos); @@ -102,11 +101,12 @@ return priv; } -static void dvdnav_get_highlight (dvdnav_priv_t *priv, dvdnav_highlight_event_t *hlev, int display_mode) { +static void dvdnav_get_highlight (dvdnav_priv_t *priv, int display_mode) { pci_t *pnavpci = NULL; - int btnum = -1; + dvdnav_highlight_event_t *hlev = &(priv->hlev); + int btnum; - if (!priv || !priv->dvdnav || !hlev) + if (!priv || !priv->dvdnav) return; pnavpci = dvdnav_get_current_nav_pci (priv->dvdnav); @@ -168,7 +168,7 @@ break; } case DVDNAV_HIGHLIGHT: { - dvdnav_get_highlight (priv, &dvd_nav_hl, 1); + dvdnav_get_highlight (priv, 1); break; } case DVDNAV_CELL_CHANGE: { @@ -256,7 +256,7 @@ update_title_len(s); if(dvdnav_current_title_info(priv->dvdnav, &tit, &part) == DVDNAV_STATUS_OK) { mp_msg(MSGT_CPLAYER,MSGL_V, "\r\nDVDNAV, NEW TITLE %d\r\n", tit); - dvdnav_get_highlight (priv, &dvd_nav_hl, 0); + dvdnav_get_highlight (priv, 0); if(priv->title > 0 && tit != priv->title) return 0; } @@ -496,11 +496,14 @@ 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; +void mp_dvdnav_get_highlight (stream_t *stream, nav_highlight_t *hl) { + dvdnav_priv_t *priv = (dvdnav_priv_t *) stream->priv; + dvdnav_highlight_event_t hlev = priv->hlev; + + hl->sx = hlev.sx; + hl->sy = hlev.sy; + hl->ex = hlev.ex; + hl->ey = hlev.ey; } stream_info_t stream_info_dvdnav = { diff -r f9014ec91226 -r 8258747951d7 stream/stream_dvdnav.h --- a/stream/stream_dvdnav.h Sat Nov 25 17:31:07 2006 +0000 +++ b/stream/stream_dvdnav.h Sat Nov 25 17:44:22 2006 +0000 @@ -24,6 +24,7 @@ unsigned int duration; /* in milliseconds */ int mousex, mousey; int title; + dvdnav_highlight_event_t hlev; } dvdnav_priv_t; @@ -31,6 +32,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); +void mp_dvdnav_get_highlight (stream_t *stream, nav_highlight_t *hl); #endif