changeset 20405:a11a208925b9

don't play any other title other than N when N is specified (with dvdnav://N)
author nicodvb
date Mon, 23 Oct 2006 21:04:31 +0000
parents 07238c655349
children 831cd8cbf58a
files stream/stream_dvdnav.c stream/stream_dvdnav.h
diffstat 2 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/stream/stream_dvdnav.c	Mon Oct 23 19:12:26 2006 +0000
+++ b/stream/stream_dvdnav.c	Mon Oct 23 21:04:31 2006 +0000
@@ -213,8 +213,15 @@
             case DVDNAV_STOP: return len;
 	    case DVDNAV_BLOCK_OK: return len;
             case DVDNAV_VTS_CHANGE: {
+                int tit = 0, part = 0;
+                dvdnav_vts_change_event_t *evt = (dvdnav_vts_change_event_t*)but;
                 s->end_pos = 0;
                 update_title_len(s);
+                if(dvdnav_current_title_info(dvdnav_priv->dvdnav, &tit, &part) == DVDNAV_STATUS_OK) {
+                  mp_msg(MSGT_CPLAYER,MSGL_V, "\r\nDVDNAV, NEW VTS event: VTS %d, title %d\r\n", evt->new_vtsN, tit);
+                  if(dvdnav_priv->title > 0 && tit != dvdnav_priv->title)
+                    return 0;
+                }
                 break;
             }
         }
@@ -287,6 +294,7 @@
   }
 
   if(p->track > 0) {
+  dvdnav_priv->title = p->track;
   if(dvdnav_title_play(dvdnav_priv->dvdnav, p->track) != DVDNAV_STATUS_OK) {
     mp_msg(MSGT_OPEN,MSGL_FATAL,"dvdnav_stream, couldn't select title %d, error '%s'\n", p->track, dvdnav_err_to_string(dvdnav_priv->dvdnav));
     return STREAM_UNSUPORTED;
--- a/stream/stream_dvdnav.h	Mon Oct 23 19:12:26 2006 +0000
+++ b/stream/stream_dvdnav.h	Mon Oct 23 21:04:31 2006 +0000
@@ -20,6 +20,7 @@
   int              prelen;              /* length of prefill buffer */
   unsigned int     duration;            /* in milliseconds */
   int              mousex, mousey;
+  int              title;
 } dvdnav_priv_t;
 
 extern int dvd_nav_still;