comparison stream/stream_dvdnav.c @ 21219:8258747951d7

keep nav highlight event in dvdnav priv structure
author ben
date Sat, 25 Nov 2006 17:44:22 +0000
parents 1ddb1a86e419
children 7f53c807d593
comparison
equal deleted inserted replaced
21218:f9014ec91226 21219:8258747951d7
44 &stream_priv_dflts, 44 &stream_priv_dflts,
45 stream_opts_fields 45 stream_opts_fields
46 }; 46 };
47 47
48 int dvd_nav_still=0; /* are we on a still picture? */ 48 int dvd_nav_still=0; /* are we on a still picture? */
49 static dvdnav_highlight_event_t dvd_nav_hl;
50 49
51 static int seek(stream_t *s, off_t newpos); 50 static int seek(stream_t *s, off_t newpos);
52 51
53 static dvdnav_priv_t * new_dvdnav_stream(char * filename) { 52 static dvdnav_priv_t * new_dvdnav_stream(char * filename) {
54 char * title_str; 53 char * title_str;
100 //dvdnav_event_clear(priv); 99 //dvdnav_event_clear(priv);
101 100
102 return priv; 101 return priv;
103 } 102 }
104 103
105 static void dvdnav_get_highlight (dvdnav_priv_t *priv, dvdnav_highlight_event_t *hlev, int display_mode) { 104 static void dvdnav_get_highlight (dvdnav_priv_t *priv, int display_mode) {
106 pci_t *pnavpci = NULL; 105 pci_t *pnavpci = NULL;
107 int btnum = -1; 106 dvdnav_highlight_event_t *hlev = &(priv->hlev);
108 107 int btnum;
109 if (!priv || !priv->dvdnav || !hlev) 108
109 if (!priv || !priv->dvdnav)
110 return; 110 return;
111 111
112 pnavpci = dvdnav_get_current_nav_pci (priv->dvdnav); 112 pnavpci = dvdnav_get_current_nav_pci (priv->dvdnav);
113 if (!pnavpci) 113 if (!pnavpci)
114 return; 114 return;
166 dvdnav_still_skip(priv->dvdnav); // don't let dvdnav stall on this image 166 dvdnav_still_skip(priv->dvdnav); // don't let dvdnav stall on this image
167 167
168 break; 168 break;
169 } 169 }
170 case DVDNAV_HIGHLIGHT: { 170 case DVDNAV_HIGHLIGHT: {
171 dvdnav_get_highlight (priv, &dvd_nav_hl, 1); 171 dvdnav_get_highlight (priv, 1);
172 break; 172 break;
173 } 173 }
174 case DVDNAV_CELL_CHANGE: { 174 case DVDNAV_CELL_CHANGE: {
175 dvdnav_cell_change_event_t *ev = (dvdnav_cell_change_event_t*)buf; 175 dvdnav_cell_change_event_t *ev = (dvdnav_cell_change_event_t*)buf;
176 if(ev->pgc_length) 176 if(ev->pgc_length)
254 int tit = 0, part = 0; 254 int tit = 0, part = 0;
255 s->end_pos = 0; 255 s->end_pos = 0;
256 update_title_len(s); 256 update_title_len(s);
257 if(dvdnav_current_title_info(priv->dvdnav, &tit, &part) == DVDNAV_STATUS_OK) { 257 if(dvdnav_current_title_info(priv->dvdnav, &tit, &part) == DVDNAV_STATUS_OK) {
258 mp_msg(MSGT_CPLAYER,MSGL_V, "\r\nDVDNAV, NEW TITLE %d\r\n", tit); 258 mp_msg(MSGT_CPLAYER,MSGL_V, "\r\nDVDNAV, NEW TITLE %d\r\n", tit);
259 dvdnav_get_highlight (priv, &dvd_nav_hl, 0); 259 dvdnav_get_highlight (priv, 0);
260 if(priv->title > 0 && tit != priv->title) 260 if(priv->title > 0 && tit != priv->title)
261 return 0; 261 return 0;
262 } 262 }
263 break; 263 break;
264 } 264 }
494 n++; 494 n++;
495 } 495 }
496 return n; 496 return n;
497 } 497 }
498 498
499 void mp_dvdnav_get_highlight (nav_highlight_t *hl) { 499 void mp_dvdnav_get_highlight (stream_t *stream, nav_highlight_t *hl) {
500 hl->sx = dvd_nav_hl.sx; 500 dvdnav_priv_t *priv = (dvdnav_priv_t *) stream->priv;
501 hl->sy = dvd_nav_hl.sy; 501 dvdnav_highlight_event_t hlev = priv->hlev;
502 hl->ex = dvd_nav_hl.ex; 502
503 hl->ey = dvd_nav_hl.ey; 503 hl->sx = hlev.sx;
504 hl->sy = hlev.sy;
505 hl->ex = hlev.ex;
506 hl->ey = hlev.ey;
504 } 507 }
505 508
506 stream_info_t stream_info_dvdnav = { 509 stream_info_t stream_info_dvdnav = {
507 "DVDNAV stream", 510 "DVDNAV stream",
508 "null", 511 "null",