[vlc-commits] ts: implement DEMUX_GET_NORMAL_TIME

Thomas Guillem git at videolan.org
Mon Sep 23 13:36:20 CEST 2019


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Sep 10 18:27:03 2019 +0200| [72ef412d7f809c965449c297798f7d26f39c27be] | committer: Thomas Guillem

ts: implement DEMUX_GET_NORMAL_TIME

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

 modules/demux/mpeg/ts.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/modules/demux/mpeg/ts.c b/modules/demux/mpeg/ts.c
index 93009d487a..5be93c74bf 100644
--- a/modules/demux/mpeg/ts.c
+++ b/modules/demux/mpeg/ts.c
@@ -1040,6 +1040,14 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
             return VLC_SUCCESS;
         }
         break;
+    case DEMUX_GET_NORMAL_TIME:
+        if ((p_sys->b_access_control && !EITCurrentEventTime( p_pmt, p_sys, NULL, NULL))
+         || (!p_pmt || p_pmt->pcr.i_current == -1 || p_pmt->pcr.i_first == -1))
+            return VLC_EGENERIC; /* use VLC_TICK_0 as Normal Play Time*/
+
+        /* Use the first pcr of the current program as Normal Play Time */
+        *va_arg( args, vlc_tick_t * ) = FROM_SCALE( p_pmt->pcr.i_first );
+        return VLC_SUCCESS;
 
     case DEMUX_GET_LENGTH:
         if( p_sys->b_access_control )



More information about the vlc-commits mailing list