[vlc-commits] demux: ts: add DEMUX_SET_TIME

Francois Cartegnie git at videolan.org
Sun Feb 22 16:44:00 CET 2015


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Sun Feb 22 16:13:18 2015 +0100| [4155ce80e03aa745f2d180660c64d8817dda2c69] | committer: Francois Cartegnie

demux: ts: add DEMUX_SET_TIME

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

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

diff --git a/modules/demux/ts.c b/modules/demux/ts.c
index 1324a80..09e9611 100644
--- a/modules/demux/ts.c
+++ b/modules/demux/ts.c
@@ -1554,6 +1554,21 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
         }
         break;
 
+    case DEMUX_SET_TIME:
+        i64 = (int64_t)va_arg( args, int64_t );
+
+        if( p_sys->b_canseek &&
+           (p_prg = GetProgramByID( p_sys, i_first_program )) &&
+            p_prg->pcr.i_first > -1 &&
+           !SeekToTime( p_demux, p_prg, p_prg->pcr.i_first + TO_SCALE(i64) ) )
+        {
+            ReadyQueuesPostSeek( p_sys );
+            es_out_Control( p_demux->out, ES_OUT_SET_NEXT_DISPLAY_TIME,
+                            FROM_SCALE(p_prg->pcr.i_first) + i64 - VLC_TS_0 );
+            return VLC_SUCCESS;
+        }
+        break;
+
     case DEMUX_GET_TIME:
         pi64 = (int64_t*)va_arg( args, int64_t * );
 



More information about the vlc-commits mailing list