[vlc-commits] use mtime_t for ES_OUT_SET_PCR

Steve Lhomme git at videolan.org
Sat May 5 19:41:11 CEST 2018


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Sat May  5 14:31:20 2018 +0200| [8571288de4fee6f9e5a75c7e7d773d2c05e79324] | committer: Rémi Denis-Courmont

use mtime_t for ES_OUT_SET_PCR

Signed-off-by: Rémi Denis-Courmont <remi at remlab.net>

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

 include/vlc_es_out.h                          |  6 +++---
 modules/access/live555.cpp                    |  2 +-
 modules/demux/adaptive/plumbing/FakeESOut.cpp |  2 +-
 modules/demux/aiff.c                          |  2 +-
 modules/demux/avformat/demux.c                |  8 ++++----
 modules/demux/flac.c                          |  2 +-
 modules/demux/mkv/mkv.cpp                     |  2 +-
 modules/demux/stl.c                           |  4 ++--
 modules/demux/subtitle.c                      |  2 +-
 modules/demux/ttml.c                          |  6 +++---
 modules/demux/webvtt.c                        |  2 +-
 src/input/es_out.c                            |  2 +-
 src/input/es_out_timeshift.c                  | 10 +++++-----
 13 files changed, 25 insertions(+), 25 deletions(-)

diff --git a/include/vlc_es_out.h b/include/vlc_es_out.h
index 1199461c2a..5f70251dc7 100644
--- a/include/vlc_es_out.h
+++ b/include/vlc_es_out.h
@@ -60,8 +60,8 @@ enum es_out_query_e
      * XXX: if you want PREROLL just call ES_OUT_SET_NEXT_DISPLAY_TIME and send
      * as you would normally do.
      */
-    ES_OUT_SET_PCR,             /* arg1=int64_t i_pcr(microsecond!) (using default group 0)*/
-    ES_OUT_SET_GROUP_PCR,       /* arg1= int i_group, arg2=int64_t i_pcr(microsecond!)*/
+    ES_OUT_SET_PCR,             /* arg1=mtime_t i_pcr(microsecond!) (using default group 0)*/
+    ES_OUT_SET_GROUP_PCR,       /* arg1= int i_group, arg2=mtime_t i_pcr(microsecond!)*/
     ES_OUT_RESET_PCR,           /* no arg */
 
     /* Try not to use this one as it is a bit hacky */
@@ -157,7 +157,7 @@ static inline void es_out_Delete( es_out_t *p_out )
     p_out->pf_destroy( p_out );
 }
 
-static inline int es_out_SetPCR( es_out_t *out, int64_t pcr )
+static inline int es_out_SetPCR( es_out_t *out, mtime_t pcr )
 {
     return es_out_Control( out, ES_OUT_SET_PCR, pcr );
 }
diff --git a/modules/access/live555.cpp b/modules/access/live555.cpp
index dddd7496ea..6019eecbb7 100644
--- a/modules/access/live555.cpp
+++ b/modules/access/live555.cpp
@@ -215,7 +215,7 @@ struct demux_sys_t
     bool             b_real;
 
     /* */
-    int64_t          i_pcr; /* The clock */
+    mtime_t          i_pcr; /* The clock */
     bool             b_rtcp_sync; /* At least one track received sync */
     double           f_npt;
     double           f_npt_length;
diff --git a/modules/demux/adaptive/plumbing/FakeESOut.cpp b/modules/demux/adaptive/plumbing/FakeESOut.cpp
index 8814be37c9..73b39954b9 100644
--- a/modules/demux/adaptive/plumbing/FakeESOut.cpp
+++ b/modules/demux/adaptive/plumbing/FakeESOut.cpp
@@ -365,7 +365,7 @@ int FakeESOut::esOutControl_Callback(es_out_t *fakees, int i_query, va_list args
                 i_group = va_arg( args, int );
             else
                 i_group = 0;
-            int64_t  pcr = va_arg( args, int64_t );
+            mtime_t  pcr = va_arg( args, mtime_t );
             me->checkTimestampsStart( pcr );
             pcr += me->getTimestampOffset();
             AbstractCommand *command = me->commandsqueue->factory()->createEsOutControlPCRCommand( i_group, pcr );
diff --git a/modules/demux/aiff.c b/modules/demux/aiff.c
index d6c2aebffe..1fce0b5b22 100644
--- a/modules/demux/aiff.c
+++ b/modules/demux/aiff.c
@@ -72,7 +72,7 @@ typedef struct
 
     int         i_ssnd_fsize;
 
-    int64_t     i_time;
+    mtime_t     i_time;
 } demux_sys_t;
 
 static int Demux  ( demux_t *p_demux );
diff --git a/modules/demux/avformat/demux.c b/modules/demux/avformat/demux.c
index 9ec81b7053..3e3d40f0ef 100644
--- a/modules/demux/avformat/demux.c
+++ b/modules/demux/avformat/demux.c
@@ -69,7 +69,7 @@ typedef struct
     struct avformat_track_s *tracks;
     unsigned i_tracks;
 
-    int64_t         i_pcr;
+    mtime_t         i_pcr;
 
     unsigned    i_ssa_order;
 
@@ -855,14 +855,14 @@ static int Demux( demux_t *p_demux )
     if( p_frame->i_dts != VLC_TS_INVALID && p_track->p_es != NULL )
         p_track->i_pcr = p_frame->i_dts;
 
-    int64_t i_ts_max = INT64_MIN;
+    mtime_t i_ts_max = INT64_MIN;
     for( unsigned i = 0; i < p_sys->i_tracks; i++ )
     {
         if( p_sys->tracks[i].p_es != NULL )
             i_ts_max = __MAX( i_ts_max, p_sys->tracks[i].i_pcr );
     }
 
-    int64_t i_ts_min = INT64_MAX;
+    mtime_t i_ts_min = INT64_MAX;
     for( unsigned i = 0; i < p_sys->i_tracks; i++ )
     {
         if( p_sys->tracks[i].p_es != NULL &&
@@ -908,7 +908,7 @@ static void UpdateSeekPoint( demux_t *p_demux, int64_t i_time )
     }
 }
 
-static void ResetTime( demux_t *p_demux, int64_t i_time )
+static void ResetTime( demux_t *p_demux, mtime_t i_time )
 {
     demux_sys_t *p_sys = p_demux->p_sys;
 
diff --git a/modules/demux/flac.c b/modules/demux/flac.c
index c5900c26ed..0373e10403 100644
--- a/modules/demux/flac.c
+++ b/modules/demux/flac.c
@@ -82,7 +82,7 @@ typedef struct
 
     vlc_meta_t *p_meta;
 
-    int64_t i_pts;
+    mtime_t i_pts;
     struct flac_stream_info stream_info;
     bool b_stream_info;
 
diff --git a/modules/demux/mkv/mkv.cpp b/modules/demux/mkv/mkv.cpp
index 88bc52781b..4154cd89c5 100644
--- a/modules/demux/mkv/mkv.cpp
+++ b/modules/demux/mkv/mkv.cpp
@@ -773,7 +773,7 @@ static int Demux( demux_t *p_demux)
 
     /* update pcr */
     {
-        int64_t i_pcr = VLC_TS_INVALID;
+        mtime_t i_pcr = VLC_TS_INVALID;
 
         typedef matroska_segment_c::tracks_map_t tracks_map_t;
 
diff --git a/modules/demux/stl.c b/modules/demux/stl.c
index eb6fc563f2..463dc73436 100644
--- a/modules/demux/stl.c
+++ b/modules/demux/stl.c
@@ -66,7 +66,7 @@ typedef struct
     es_out_id_t *es;
 
     size_t      current;
-    int64_t     next_date;
+    mtime_t     next_date;
     bool        b_slave;
     bool        b_first_time;
 } demux_sys_t;
@@ -179,7 +179,7 @@ static int Demux(demux_t *demux)
 {
     demux_sys_t *sys = demux->p_sys;
 
-    int64_t i_barrier = sys->next_date - var_GetInteger(demux->obj.parent, "spu-delay");
+    mtime_t i_barrier = sys->next_date - var_GetInteger(demux->obj.parent, "spu-delay");
     if(i_barrier < 0)
         i_barrier = sys->next_date;
 
diff --git a/modules/demux/subtitle.c b/modules/demux/subtitle.c
index 9f953445ef..90b2c57eff 100644
--- a/modules/demux/subtitle.c
+++ b/modules/demux/subtitle.c
@@ -851,7 +851,7 @@ static int Demux( demux_t *p_demux )
 {
     demux_sys_t *p_sys = p_demux->p_sys;
 
-    int64_t i_barrier = p_sys->i_next_demux_date - var_GetInteger( p_demux->obj.parent, "spu-delay" );
+    mtime_t i_barrier = p_sys->i_next_demux_date - var_GetInteger( p_demux->obj.parent, "spu-delay" );
     if( i_barrier < 0 )
         i_barrier = p_sys->i_next_demux_date;
 
diff --git a/modules/demux/ttml.c b/modules/demux/ttml.c
index ace89eb2be..76a38a02cc 100644
--- a/modules/demux/ttml.c
+++ b/modules/demux/ttml.c
@@ -46,7 +46,7 @@ typedef struct
     xml_t*          p_xml;
     xml_reader_t*   p_reader;
     es_out_id_t*    p_es;
-    int64_t         i_next_demux_time;
+    mtime_t         i_next_demux_time;
     bool            b_slave;
     bool            b_first_time;
 
@@ -349,9 +349,9 @@ static int Demux( demux_t* p_demux )
     while( p_sys->times.i_current + 1 < p_sys->times.i_count &&
            tt_time_Convert( &p_sys->times.p_array[p_sys->times.i_current] ) <= p_sys->i_next_demux_time )
     {
-        const int64_t i_playbacktime =
+        const mtime_t i_playbacktime =
                 tt_time_Convert( &p_sys->times.p_array[p_sys->times.i_current] );
-        const int64_t i_playbackendtime =
+        const mtime_t i_playbackendtime =
                 tt_time_Convert( &p_sys->times.p_array[p_sys->times.i_current + 1] ) - 1;
 
         if ( !p_sys->b_slave && p_sys->b_first_time )
diff --git a/modules/demux/webvtt.c b/modules/demux/webvtt.c
index 85311b2494..4dcdec2e4f 100644
--- a/modules/demux/webvtt.c
+++ b/modules/demux/webvtt.c
@@ -533,7 +533,7 @@ static int Demux( demux_t *p_demux )
 {
     demux_sys_t *p_sys = p_demux->p_sys;
 
-    int64_t i_barrier = p_sys->i_next_demux_time;
+    mtime_t i_barrier = p_sys->i_next_demux_time;
 
     while( p_sys->index.i_current < p_sys->index.i_count &&
            p_sys->index.p_array[p_sys->index.i_current].time <= i_barrier )
diff --git a/src/input/es_out.c b/src/input/es_out.c
index 6f74a49879..fcad73b5d9 100644
--- a/src/input/es_out.c
+++ b/src/input/es_out.c
@@ -2490,7 +2490,7 @@ static int EsOutControlLocked( es_out_t *out, int i_query, va_list args )
         if( !p_pgrm )
             return VLC_EGENERIC;
 
-        i_pcr = va_arg( args, int64_t );
+        i_pcr = va_arg( args, mtime_t );
         if( i_pcr == VLC_TS_INVALID )
         {
             msg_Err( p_sys->p_input, "Invalid PCR value in ES_OUT_SET_(GROUP_)PCR !" );
diff --git a/src/input/es_out_timeshift.c b/src/input/es_out_timeshift.c
index 959820fb84..b048a47887 100644
--- a/src/input/es_out_timeshift.c
+++ b/src/input/es_out_timeshift.c
@@ -1370,14 +1370,14 @@ static int CmdInitControl( ts_cmd_t *p_cmd, int i_query, va_list args, bool b_co
         p_cmd->u.control.u.i_int = (int)va_arg( args, int );
         break;
 
-    case ES_OUT_SET_PCR:                /* arg1=int64_t i_pcr(microsecond!) (using default group 0)*/
+    case ES_OUT_SET_PCR:                /* arg1=mtime_t i_pcr(microsecond!) (using default group 0)*/
     case ES_OUT_SET_NEXT_DISPLAY_TIME:  /* arg1=int64_t i_pts(microsecond) */
         p_cmd->u.control.u.i_i64 = (int64_t)va_arg( args, int64_t );
         break;
 
-    case ES_OUT_SET_GROUP_PCR:          /* arg1= int i_group, arg2=int64_t i_pcr(microsecond!)*/
+    case ES_OUT_SET_GROUP_PCR:          /* arg1= int i_group, arg2=mtime_t i_pcr(microsecond!)*/
         p_cmd->u.control.u.int_i64.i_int = (int)va_arg( args, int );
-        p_cmd->u.control.u.int_i64.i_i64 = (int64_t)va_arg( args, int64_t );
+        p_cmd->u.control.u.int_i64.i_i64 = (int64_t)va_arg( args, mtime_t );
         break;
 
     case ES_OUT_SET_ES_SCRAMBLED_STATE:
@@ -1529,11 +1529,11 @@ static int CmdExecuteControl( es_out_t *p_out, ts_cmd_t *p_cmd )
     case ES_OUT_DEL_GROUP:   /* arg1=int i_group */
         return es_out_Control( p_out, i_query, p_cmd->u.control.u.i_int );
 
-    case ES_OUT_SET_PCR:                /* arg1=int64_t i_pcr(microsecond!) (using default group 0)*/
+    case ES_OUT_SET_PCR:                /* arg1=mtime_t i_pcr(microsecond!) (using default group 0)*/
     case ES_OUT_SET_NEXT_DISPLAY_TIME:  /* arg1=int64_t i_pts(microsecond) */
         return es_out_Control( p_out, i_query, p_cmd->u.control.u.i_i64 );
 
-    case ES_OUT_SET_GROUP_PCR:          /* arg1= int i_group, arg2=int64_t i_pcr(microsecond!)*/
+    case ES_OUT_SET_GROUP_PCR:          /* arg1= int i_group, arg2=mtime_t i_pcr(microsecond!)*/
         return es_out_Control( p_out, i_query, p_cmd->u.control.u.int_i64.i_int,
                                                p_cmd->u.control.u.int_i64.i_i64 );
 



More information about the vlc-commits mailing list