Commit 38a2d9d9 authored by massiot's avatar massiot

* demux.c: Randomize TSID in unique TSID mode.


git-svn-id: svn://svn.videolan.org/dvblast/trunk@24 55d3f8b6-4a41-4d2d-a900-313d1436a5b8
parent 5f1a8335
...@@ -746,8 +746,8 @@ static void SendEIT( dvbpsi_psi_section_t *p_section, uint16_t i_sid, ...@@ -746,8 +746,8 @@ static void SendEIT( dvbpsi_psi_section_t *p_section, uint16_t i_sid,
{ {
if( b_unique_tsid ) if( b_unique_tsid )
{ {
p_section->p_data[8] = (i_sid >> 8) & 0xff; p_section->p_data[8] = (pp_outputs[i]->i_ts_id >> 8) & 0xff;
p_section->p_data[9] = i_sid & 0xff; p_section->p_data[9] = pp_outputs[i]->i_ts_id & 0xff;
} }
dvbpsi_BuildPSISection( p_section ); dvbpsi_BuildPSISection( p_section );
...@@ -800,7 +800,7 @@ static void NewPAT( output_t *p_output ) ...@@ -800,7 +800,7 @@ static void NewPAT( output_t *p_output )
} }
if ( b_unique_tsid ) if ( b_unique_tsid )
dvbpsi_InitPAT( &pat, p_output->i_sid, p_output->i_pat_version, 1 ); dvbpsi_InitPAT( &pat, p_output->i_ts_id, p_output->i_pat_version, 1 );
else else
dvbpsi_InitPAT( &pat, p_current_pat->i_ts_id, p_output->i_pat_version, 1 ); dvbpsi_InitPAT( &pat, p_current_pat->i_ts_id, p_output->i_pat_version, 1 );
...@@ -1301,7 +1301,7 @@ static void SDTCallback( void *_unused, dvbpsi_sdt_t *p_sdt ) ...@@ -1301,7 +1301,7 @@ static void SDTCallback( void *_unused, dvbpsi_sdt_t *p_sdt )
p_new_sdt = malloc(sizeof(dvbpsi_sdt_t)); p_new_sdt = malloc(sizeof(dvbpsi_sdt_t));
if ( b_unique_tsid ) if ( b_unique_tsid )
dvbpsi_InitSDT( p_new_sdt, p_service->i_service_id, dvbpsi_InitSDT( p_new_sdt, pp_outputs[i]->i_ts_id,
p_sdt->i_version, p_sdt->b_current_next, p_sdt->i_version, p_sdt->b_current_next,
p_sdt->i_network_id ); p_sdt->i_network_id );
else else
......
...@@ -68,6 +68,7 @@ typedef struct output_t ...@@ -68,6 +68,7 @@ typedef struct output_t
dvbpsi_psi_section_t *p_sdt_section; dvbpsi_psi_section_t *p_sdt_section;
uint8_t i_sdt_cc; uint8_t i_sdt_cc;
uint8_t i_eit_cc; uint8_t i_eit_cc;
uint16_t i_ts_id;
/* configuration */ /* configuration */
uint16_t i_sid; /* 0 if raw mode */ uint16_t i_sid; /* 0 if raw mode */
......
...@@ -94,6 +94,8 @@ int output_Init( output_t *p_output, in_addr_t i_maddr, uint16_t i_port ) ...@@ -94,6 +94,8 @@ int output_Init( output_t *p_output, in_addr_t i_maddr, uint16_t i_port )
p_output->p_pat_section = NULL; p_output->p_pat_section = NULL;
p_output->p_pmt_section = NULL; p_output->p_pmt_section = NULL;
p_output->p_sdt_section = NULL; p_output->p_sdt_section = NULL;
if ( b_unique_tsid )
p_output->i_ts_id = rand() & 0xffff;
p_output->i_ref_timestamp = 0; p_output->i_ref_timestamp = 0;
p_output->i_ref_wallclock = 0; p_output->i_ref_wallclock = 0;
......
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