mirror of
https://github.com/mpv-player/mpv
synced 2025-01-02 21:12:23 +00:00
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
This commit is contained in:
parent
2276bef69c
commit
2c4331cbcc
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user