[vlc-commits] access: dvdnav: impl SET_TIME using jump_to_sector_by_time

Francois Cartegnie git at videolan.org
Mon Jan 27 22:56:16 CET 2020


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed Jan 22 08:58:32 2020 +0100| [59ea3e67fbc7ff5a649cc549ec512ffe55d62a51] | committer: Francois Cartegnie

access: dvdnav: impl SET_TIME using jump_to_sector_by_time

allows resuming playback with start-time

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

 modules/access/dvdnav.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/modules/access/dvdnav.c b/modules/access/dvdnav.c
index d693bdb07e..3ea3b9ef36 100644
--- a/modules/access/dvdnav.c
+++ b/modules/access/dvdnav.c
@@ -58,6 +58,8 @@
 
 
 #include <dvdnav/dvdnav.h>
+/* Expose without patching headers */
+dvdnav_status_t dvdnav_jump_to_sector_by_time(dvdnav_t *, uint64_t, int32_t);
 
 #include "../demux/mpeg/pes.h"
 #include "../demux/mpeg/ps.h"
@@ -585,6 +587,17 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
             }
             break;
 
+        case DEMUX_SET_TIME:
+        {
+            vlc_tick_t i_time = va_arg( args, vlc_tick_t );
+            if( dvdnav_jump_to_sector_by_time( p_sys->dvdnav,
+                                               i_time * 9 / 100,
+                                               SEEK_SET ) == DVDNAV_STATUS_OK )
+                return VLC_SUCCESS;
+            msg_Err( p_demux, "can't set time to %" PRId64, i_time );
+            return VLC_EGENERIC;
+        }
+
         /* Special for access_demux */
         case DEMUX_CAN_PAUSE:
         case DEMUX_CAN_SEEK:



More information about the vlc-commits mailing list