summaryrefslogtreecommitdiffstats
path: root/stream/stream_dvdnav.c
diff options
context:
space:
mode:
authornicodvb <nicodvb@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-08-19 19:41:04 +0000
committernicodvb <nicodvb@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-08-19 19:41:04 +0000
commit84c982c65fcd3d26849891bfb55f3f6a8aff4059 (patch)
tree14b03198dfc77fe8c0e69aa880800ef86041d403 /stream/stream_dvdnav.c
parent2dfbc4cea7de7c9e340fb232949f3923a9d30772 (diff)
downloadmpv-84c982c65fcd3d26849891bfb55f3f6a8aff4059.tar.bz2
mpv-84c982c65fcd3d26849891bfb55f3f6a8aff4059.tar.xz
implemented STREAM_CTRL_GET_TIME_LENGTH (duration of the pgc playing)
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19459 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'stream/stream_dvdnav.c')
-rw-r--r--stream/stream_dvdnav.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/stream/stream_dvdnav.c b/stream/stream_dvdnav.c
index 66e4d8bd72..475a53d408 100644
--- a/stream/stream_dvdnav.c
+++ b/stream/stream_dvdnav.c
@@ -216,6 +216,12 @@ int dvdnav_stream_read(dvdnav_priv_t * dvdnav_priv, unsigned char *buf, int *len
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 @@ static int control(stream_t *stream, int cmd, void* arg) {
*((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;