Commit 24dafcdc authored by Michel Kaempf's avatar Michel Kaempf

* include/decoder_fifo.h :

- Proprification des commentaires ;

* include/input.h :
- i_pts �tait un u32 mais doit �tre un s64 ;
- Question ouverte au Ptyx : pourquoi mtime_t est un u64 ?
  Est-ce que c'est mauvais de passer mtime_t en s64 ?
  Est-ce que �a fait modifier beaucoup de code ?

* input/input.c :
- Correction d'un cast ;

-- MaXX
parent dcf6637a
...@@ -41,8 +41,10 @@ typedef struct ...@@ -41,8 +41,10 @@ typedef struct
} decoder_fifo_t; } decoder_fifo_t;
/****************************************************************************** * bit_fifo_t : bit fifo descriptor /******************************************************************************
****************************************************************************** * This type describes a bit fifo used to store bits while working with the * bit_fifo_t : bit fifo descriptor
******************************************************************************
* This type describes a bit fifo used to store bits while working with the
* input stream at the bit level. * input stream at the bit level.
******************************************************************************/ ******************************************************************************/
typedef struct bit_fifo_s typedef struct bit_fifo_s
...@@ -57,8 +59,10 @@ typedef struct bit_fifo_s ...@@ -57,8 +59,10 @@ typedef struct bit_fifo_s
} bit_fifo_t; } bit_fifo_t;
/****************************************************************************** * bit_stream_t : bit stream descriptor /******************************************************************************
****************************************************************************** * This type, based on a PES stream, includes all the structures needed to * bit_stream_t : bit stream descriptor
******************************************************************************
* This type, based on a PES stream, includes all the structures needed to
* handle the input stream like a bit stream. * handle the input stream like a bit stream.
******************************************************************************/ ******************************************************************************/
typedef struct bit_stream_s typedef struct bit_stream_s
...@@ -148,9 +152,11 @@ static __inline__ byte_t GetByte( bit_stream_t * p_bit_stream ) ...@@ -148,9 +152,11 @@ static __inline__ byte_t GetByte( bit_stream_t * p_bit_stream )
} }
} }
/****************************************************************************** * NeedBits : reads i_bits new bits in the bit stream and stores them in the /******************************************************************************
* NeedBits : reads i_bits new bits in the bit stream and stores them in the
* bit buffer * bit buffer
****************************************************************************** * - i_bits must be less or equal 32 ! ******************************************************************************
* - i_bits must be less or equal 32 !
* - There is something important to notice with that function : if the number * - There is something important to notice with that function : if the number
* of bits available in the bit buffer when calling NeedBits() is greater than * of bits available in the bit buffer when calling NeedBits() is greater than
* 24 (i_available > 24) but less than the number of needed bits * 24 (i_available > 24) but less than the number of needed bits
...@@ -167,8 +173,10 @@ static __inline__ void NeedBits( bit_stream_t * p_bit_stream, int i_bits ) ...@@ -167,8 +173,10 @@ static __inline__ void NeedBits( bit_stream_t * p_bit_stream, int i_bits )
} }
} }
/****************************************************************************** * DumpBits : removes i_bits bits from the bit buffer /******************************************************************************
****************************************************************************** * - i_bits <= i_available * DumpBits : removes i_bits bits from the bit buffer
******************************************************************************
* - i_bits <= i_available
* - i_bits < 32 (because (u32 << 32) <=> (u32 = u32)) * - i_bits < 32 (because (u32 << 32) <=> (u32 = u32))
******************************************************************************/ ******************************************************************************/
static __inline__ void DumpBits( bit_stream_t * p_bit_stream, int i_bits ) static __inline__ void DumpBits( bit_stream_t * p_bit_stream, int i_bits )
...@@ -176,4 +184,3 @@ static __inline__ void DumpBits( bit_stream_t * p_bit_stream, int i_bits ) ...@@ -176,4 +184,3 @@ static __inline__ void DumpBits( bit_stream_t * p_bit_stream, int i_bits )
p_bit_stream->fifo.buffer <<= i_bits; p_bit_stream->fifo.buffer <<= i_bits;
p_bit_stream->fifo.i_available -= i_bits; p_bit_stream->fifo.i_available -= i_bits;
} }
...@@ -60,7 +60,7 @@ typedef struct ...@@ -60,7 +60,7 @@ typedef struct
boolean_t b_data_alignment; /* used to find the beginning of a boolean_t b_data_alignment; /* used to find the beginning of a
* video or audio unit */ * video or audio unit */
boolean_t b_has_pts; /* is the following field set ? */ boolean_t b_has_pts; /* is the following field set ? */
u32 i_pts; /* the PTS for this packet (if set above) */ s64 i_pts; /* the PTS for this packet (if set above) */
boolean_t b_random_access; boolean_t b_random_access;
/* if TRUE, in the payload of this packet, there is the first byte /* if TRUE, in the payload of this packet, there is the first byte
* of a video sequence header, or the first byte of an audio frame. * of a video sequence header, or the first byte of an audio frame.
......
...@@ -891,7 +891,7 @@ static __inline__ void input_DemuxPES( input_thread_t *p_input, ...@@ -891,7 +891,7 @@ static __inline__ void input_DemuxPES( input_thread_t *p_input,
p_pes->i_pts += p_pcr->delta_clock; p_pes->i_pts += p_pcr->delta_clock;
if( p_pcr->c_pts == 0 ) if( p_pcr->c_pts == 0 )
{ {
p_pcr->delta_decode = mdate() - p_pes->i_pts + 500000; p_pcr->delta_decode = (s64)mdate() - p_pes->i_pts + 500000;
} }
p_pes->i_pts += p_pcr->delta_decode; p_pes->i_pts += p_pcr->delta_decode;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment