[vlc-commits] access: dvdnav: use dvdnav_get_current_time

Francois Cartegnie git at videolan.org
Fri Feb 28 16:41:15 CET 2020


vlc/vlc-3.0 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri Jan 24 12:33:12 2020 +0100| [f5b382dc5b5f19550d7b829786c3007686a04935] | committer: Francois Cartegnie

access: dvdnav: use dvdnav_get_current_time

(cherry picked from commit 5d0f32f9122aaaed56d2d768bfd3941146680fdb)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=f5b382dc5b5f19550d7b829786c3007686a04935
---

 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 73f766d444..7dcd4c4ec0 100644
--- a/modules/access/dvdnav.c
+++ b/modules/access/dvdnav.c
@@ -565,7 +565,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;
@@ -590,14 +589,6 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
                 }
                 break;
 
-            case DEMUX_GET_TIME:
-                if( p_sys->i_pgc_length > 0 )
-                {
-                    *va_arg( args, int64_t * ) = p_sys->i_pgc_length*pos/len;
-                    return VLC_SUCCESS;
-                }
-                break;
-
             case DEMUX_GET_LENGTH:
                 if( p_sys->i_pgc_length > 0 )
                 {
@@ -609,6 +600,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, mtime_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