Mercurial > mplayer.hg
changeset 19453:087d4a916ea3
implemented STREAM_CTRL_GET_TIME_LENGTH (duration of the pgc playing)
author | nicodvb |
---|---|
date | Sat, 19 Aug 2006 19:41:04 +0000 |
parents | cadacb426471 |
children | b9a62caeb61b |
files | stream/stream_dvdnav.c stream/stream_dvdnav.h |
diffstat | 2 files changed, 15 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/stream/stream_dvdnav.c Sat Aug 19 19:15:23 2006 +0000 +++ b/stream/stream_dvdnav.c Sat Aug 19 19:41:04 2006 +0000 @@ -216,6 +216,12 @@ break; } + case DVDNAV_CELL_CHANGE: { + dvdnav_cell_change_event_t *ev = (dvdnav_cell_change_event_t*)buf; + if(ev->pgc_length) + dvdnav_priv->duration = ev->pgc_length/90; + break; + } case DVDNAV_WAIT: dvdnav_wait_skip(dvdnav_priv->dvdnav); break; @@ -357,6 +363,14 @@ *((unsigned int *)arg) = part - 1; return 1; } + case STREAM_CTRL_GET_TIME_LENGTH: + { + if(dvdnav_priv->duration) + { + *((unsigned int *)arg) = dvdnav_priv->duration; + return 1; + } + } } return STREAM_UNSUPORTED;
--- a/stream/stream_dvdnav.h Sat Aug 19 19:15:23 2006 +0000 +++ b/stream/stream_dvdnav.h Sat Aug 19 19:41:04 2006 +0000 @@ -18,6 +18,7 @@ int started; /* Has mplayer initialization finished? */ unsigned char prebuf[STREAM_BUFFER_SIZE]; /* prefill buffer */ int prelen; /* length of prefill buffer */ + unsigned int duration; /* in milliseconds */ } dvdnav_priv_t; extern int dvd_nav_still;