[vlc-commits] demux: mpeg: use stime_t for PES times as well
Steve Lhomme
git at videolan.org
Tue Sep 18 09:43:47 CEST 2018
vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Mon May 7 11:11:58 2018 +0200| [ee51b8bbd0daca0b8bb55c76fb1092408fbdbeb1] | committer: Steve Lhomme
demux: mpeg: use stime_t for PES times as well
It's not any kind of int64_t and not a vlc_tick_t
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ee51b8bbd0daca0b8bb55c76fb1092408fbdbeb1
---
modules/demux/mpeg/pes.h | 8 +++++---
modules/demux/mpeg/ps.h | 9 +++++----
2 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/modules/demux/mpeg/pes.h b/modules/demux/mpeg/pes.h
index 5511afb281..fa2c8ffe0c 100644
--- a/modules/demux/mpeg/pes.h
+++ b/modules/demux/mpeg/pes.h
@@ -20,7 +20,9 @@
#ifndef VLC_MPEG_PES_H
#define VLC_MPEG_PES_H
-static inline bool ExtractPESTimestamp( const uint8_t *p_data, uint8_t i_flags, int64_t *ret )
+#include "timestamps.h"
+
+static inline bool ExtractPESTimestamp( const uint8_t *p_data, uint8_t i_flags, stime_t *ret )
{
/* !warn broken muxers set incorrect flags. see #17773 and #19140 */
/* check marker bits, and i_flags = b 0010, 0011 or 0001 */
@@ -41,7 +43,7 @@ static inline bool ExtractPESTimestamp( const uint8_t *p_data, uint8_t i_flags,
}
/* PS SCR timestamp as defined in H222 2.5.3.2 */
-static inline int64_t ExtractPackHeaderTimestamp( const uint8_t *p_data )
+static inline stime_t ExtractPackHeaderTimestamp( const uint8_t *p_data )
{
return ((int64_t)(p_data[ 0]&0x38 ) << 27)|
((int64_t)(p_data[0]&0x03 ) << 28)|
@@ -54,7 +56,7 @@ static inline int64_t ExtractPackHeaderTimestamp( const uint8_t *p_data )
inline
static int ParsePESHeader( vlc_object_t *p_object, const uint8_t *p_header, size_t i_header,
- unsigned *pi_skip, int64_t *pi_dts, int64_t *pi_pts,
+ unsigned *pi_skip, stime_t *pi_dts, stime_t *pi_pts,
uint8_t *pi_stream_id, bool *pb_pes_scambling )
{
unsigned i_skip;
diff --git a/modules/demux/mpeg/ps.h b/modules/demux/mpeg/ps.h
index 3dc0598a83..0d9d30ae6f 100644
--- a/modules/demux/mpeg/ps.h
+++ b/modules/demux/mpeg/ps.h
@@ -441,9 +441,10 @@ static inline int ps_pkt_parse_pack( block_t *p_pkt, vlc_tick_t *pi_scr,
}
else if( p_pkt->i_buffer >= 12 && (p[4] >> 4) == 0x02 ) /* MPEG-1 Pack SCR, same bits as PES/PTS */
{
- if(!ExtractPESTimestamp( &p[4], 0x02, pi_scr ))
+ stime_t i_scr;
+ if(!ExtractPESTimestamp( &p[4], 0x02, &i_scr ))
return VLC_EGENERIC;
- *pi_scr = FROM_SCALE( *pi_scr );
+ *pi_scr = FROM_SCALE( i_scr );
*pi_mux_rate = ( ( p[9]&0x7f )<< 15 )|( p[10] << 7 )|( p[11] >> 1);
}
else
@@ -493,8 +494,8 @@ static inline int ps_pkt_parse_system( block_t *p_pkt, ps_psm_t *p_psm,
static inline int ps_pkt_parse_pes( vlc_object_t *p_object, block_t *p_pes, int i_skip_extra )
{
unsigned int i_skip = 0;
- vlc_tick_t i_pts = -1;
- vlc_tick_t i_dts = -1;
+ stime_t i_pts = -1;
+ stime_t i_dts = -1;
uint8_t i_stream_id = 0;
bool b_pes_scrambling = false;
More information about the vlc-commits
mailing list