[vlc-commits] demux: ts: use define for unknown value
Francois Cartegnie
git at videolan.org
Fri Sep 7 18:01:50 CEST 2018
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri Sep 7 11:39:13 2018 +0200| [d3726d7669ce352c8156dc72c5dbb9da2a1303b7] | committer: Francois Cartegnie
demux: ts: use define for unknown value
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d3726d7669ce352c8156dc72c5dbb9da2a1303b7
---
modules/demux/mpeg/ts.h | 3 ++-
modules/demux/mpeg/ts_psi.c | 2 +-
modules/demux/mpeg/ts_streams.c | 8 ++++----
modules/demux/mpeg/ts_streams_private.h | 2 +-
4 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/modules/demux/mpeg/ts.h b/modules/demux/mpeg/ts.h
index d9b6a08254..b12a7dac51 100644
--- a/modules/demux/mpeg/ts.h
+++ b/modules/demux/mpeg/ts.h
@@ -28,7 +28,8 @@ typedef struct csa_t csa_t;
#define TS_USER_PMT_NUMBER (0)
#define TS_PSI_PAT_PID 0x00
-#define SETANDVALID(a) (a != -1 && a != VLC_TICK_INVALID)
+#define TS_TICK_UNKNOWN -1
+#define SETANDVALID(a) (a != TS_TICK_UNKNOWN && a != VLC_TICK_INVALID)
typedef enum ts_standards_e
{
diff --git a/modules/demux/mpeg/ts_psi.c b/modules/demux/mpeg/ts_psi.c
index 50807c8263..e9fb6659d1 100644
--- a/modules/demux/mpeg/ts_psi.c
+++ b/modules/demux/mpeg/ts_psi.c
@@ -2143,7 +2143,7 @@ static void PMTCallBack( void *data, dvbpsi_pmt_t *p_dvbpsipmt )
UpdatePESFilters( p_demux, p_sys->seltype == PROGRAM_ALL );
/* Probe Boundaries */
- if( p_sys->b_canfastseek && p_pmt->i_last_dts == -1 )
+ if( p_sys->b_canfastseek && p_pmt->i_last_dts == TS_TICK_UNKNOWN )
{
p_pmt->i_last_dts = 0;
ProbeStart( p_demux, p_pmt->i_number );
diff --git a/modules/demux/mpeg/ts_streams.c b/modules/demux/mpeg/ts_streams.c
index 755a451d4a..e266b6e37e 100644
--- a/modules/demux/mpeg/ts_streams.c
+++ b/modules/demux/mpeg/ts_streams.c
@@ -122,16 +122,16 @@ ts_pmt_t *ts_pmt_New( demux_t *p_demux )
pmt->od.i_version = -1;
ARRAY_INIT( pmt->od.objects );
- pmt->i_last_dts = -1;
+ pmt->i_last_dts = TS_TICK_UNKNOWN;
pmt->i_last_dts_byte = 0;
pmt->p_atsc_si_basepid = NULL;
pmt->p_si_sdt_pid = NULL;
- pmt->pcr.i_current = -1;
- pmt->pcr.i_first = -1;
+ pmt->pcr.i_current = TS_TICK_UNKNOWN;
+ pmt->pcr.i_first = TS_TICK_UNKNOWN;
pmt->pcr.b_disable = false;
- pmt->pcr.i_first_dts = -1;
+ pmt->pcr.i_first_dts = TS_TICK_UNKNOWN;
pmt->pcr.i_pcroffset = -1;
pmt->pcr.b_fix_done = false;
diff --git a/modules/demux/mpeg/ts_streams_private.h b/modules/demux/mpeg/ts_streams_private.h
index 0b02911123..9836900806 100644
--- a/modules/demux/mpeg/ts_streams_private.h
+++ b/modules/demux/mpeg/ts_streams_private.h
@@ -59,7 +59,7 @@ struct ts_pmt_t
struct
{
stime_t i_current;
- stime_t i_first; // seen <> != -1
+ stime_t i_first; // seen <> != TS_TICK_UNKNOWN
/* broken PCR handling */
stime_t i_first_dts;
stime_t i_pcroffset;
More information about the vlc-commits
mailing list