[vlc-commits] access: dvdnav: use dvdnav_get_current_time
Francois Cartegnie
git at videolan.org
Mon Jan 27 22:56:15 CET 2020
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri Jan 24 12:33:12 2020 +0100| [5d0f32f9122aaaed56d2d768bfd3941146680fdb] | committer: Francois Cartegnie
access: dvdnav: use dvdnav_get_current_time
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=5d0f32f9122aaaed56d2d768bfd3941146680fdb
---
modules/access/dvdnav.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/modules/access/dvdnav.c b/modules/access/dvdnav.c
index 5ec07496bb..d693bdb07e 100644
--- a/modules/access/dvdnav.c
+++ b/modules/access/dvdnav.c
@@ -540,7 +540,6 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
{
case DEMUX_SET_POSITION:
case DEMUX_GET_POSITION:
- case DEMUX_GET_TIME:
case DEMUX_GET_LENGTH:
{
uint32_t pos, len;
@@ -566,14 +565,6 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
RandomAccessCleanup( p_sys );
break;
- case DEMUX_GET_TIME:
- if( p_sys->i_pgc_length > 0 )
- {
- *va_arg( args, vlc_tick_t * ) = p_sys->i_pgc_length*pos/len;
- return VLC_SUCCESS;
- }
- break;
-
case DEMUX_GET_LENGTH:
if( p_sys->i_pgc_length > 0 )
{
@@ -585,6 +576,15 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
return VLC_EGENERIC;
}
+ case DEMUX_GET_TIME:
+ if( p_sys->i_pgc_length > 0 )
+ {
+ *va_arg( args, vlc_tick_t * ) =
+ dvdnav_get_current_time( p_sys->dvdnav ) * 100 / 9;
+ return VLC_SUCCESS;
+ }
+ break;
+
/* Special for access_demux */
case DEMUX_CAN_PAUSE:
case DEMUX_CAN_SEEK:
More information about the vlc-commits
mailing list