From 2c4331cbccee1c9edf7350e34b74c51c4aa747dc Mon Sep 17 00:00:00 2001 From: nicodvb Date: Mon, 9 Apr 2007 16:05:58 +0000 Subject: implemented STREAM_CTRL_GET_CURRENT_TIME and STREAM_CTRL_SEEK_TO_TIME - dvdnav from mphq required git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22954 b3059339-0415-0410-9bf9-f77b7e298cf2 --- stream/stream_dvdnav.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'stream/stream_dvdnav.c') diff --git a/stream/stream_dvdnav.c b/stream/stream_dvdnav.c index 5d52b72d48..17906a3838 100644 --- a/stream/stream_dvdnav.c +++ b/stream/stream_dvdnav.c @@ -328,6 +328,26 @@ static int control(stream_t *stream, int cmd, void* arg) { } break; } +#ifdef MP_DVDNAV + case STREAM_CTRL_GET_CURRENT_TIME: + { + double tm; + tm = dvdnav_get_current_time(priv->dvdnav)/90000.0f; + if(tm != -1) + { + *((double *)arg) = tm; + return 1; + } + break; + } + case STREAM_CTRL_SEEK_TO_TIME: + { + uint64_t tm = (uint64_t) (*((double*)arg) * 90000); + if(dvdnav_time_search(priv->dvdnav, tm) == DVDNAV_STATUS_OK) + return 1; + break; + } +#endif } return STREAM_UNSUPORTED; -- cgit v1.2.3