static void Set_known( byte_t* a_known_section, u8 i_section );
static void Unset_known( byte_t* a_known_section, u8 i_section );
-
/******************************************************************************
* input_PsiInit: Initialize PSI decoder
******************************************************************************
return( 0 );
}
-
/******************************************************************************
* input_PsiClean: Clean PSI structures before dying
******************************************************************************/
return( 0 );
}
-
-
/******************************************************************************
* input_PsiRead: Read the table of programs
******************************************************************************
//pthread_mutex_unlock()
}
-
/******************************************************************************
* input_PsiDecode: Decode a PSI section
******************************************************************************
}
}
-
/******************************************************************************
* DecodeAssocSection: Decode a PAS
******************************************************************************
#undef p_descr
}
-
/******************************************************************************
* DecodePgrmMapSection: Decode a PMS
******************************************************************************
#undef p_descr
}
-
-
/******************************************************************************
* DecodeSrvDescrSection
******************************************************************************
}
}
#undef p_stream
-};
-
-
-
-
-
-
+}
/******************************************************************************
* DecodePgrmDescr
}
}
-
-
-
/******************************************************************************
* DecodeESDescriptor
******************************************************************************
}
}
-
-
/******************************************************************************
* input_AddPsiPID: Start to receive the PSI info contained in a PID
******************************************************************************
return( i_rc );
}
-
/******************************************************************************
* input_DelPsiPID: Stop to receive the PSI info contained in a PID
******************************************************************************
return( 0 );
}
-
-
/******************************************************************************
* Precalculate the 32-bit CRC table
******************************************************************************
}
}
-
/******************************************************************************
* Test the validity of a checksum
******************************************************************************
return i_crc;
}
-
-
/******************************************************************************
* Is_known: check if a given section has already been received
******************************************************************************
return b_is_known;
}
-
/******************************************************************************
* Set_known: mark a given section has having been received
******************************************************************************
a_known_section[i_byte_in_table] |= mask;
}
-
/******************************************************************************
* Unset_known: remove the 'received' mark for a given section
******************************************************************************
a_known_section[i_byte_in_table] &= mask;
}
-
/******************************************************************************
* AddStreamDescr: add and init the stream descriptor of the given input
******************************************************************************
return p_input->p_stream;
}
-
/******************************************************************************
* DestroyStreamDescr: destroy the stream desciptor of the given input
******************************************************************************
/* Free the structures that describes the programs of that stream */
for( i_index = 0; i_index < p_input->p_stream->i_pgrm_number; i_index++ )
{
- DestroyPgrmDescr( p_input, p_input->p_stream,
- p_input->p_stream->ap_programs[i_index]->i_number );
+ DestroyPgrmDescr( p_input, p_input->p_stream, p_input->p_stream->ap_programs[i_index]->i_number );
}
-
+
/* Free the table of pgrm descriptors */
free( p_input->p_stream->ap_programs );
p_input->p_stream = NULL;
}
-
/******************************************************************************
* AddPgrmDescr: add and init a program descriptor
******************************************************************************
return p_stream->ap_programs[p_stream->i_pgrm_number-1];
}
-
/******************************************************************************
* AddPgrmDescr: destroy a program descriptor
******************************************************************************
* All ES descriptions referenced in the descriptor will be deleted.
******************************************************************************/
-static void DestroyPgrmDescr(input_thread_t* p_input, stream_descriptor_t* p_stream, u16 i_pgrm_id)
+static void DestroyPgrmDescr( input_thread_t * p_input, stream_descriptor_t * p_stream, u16 i_pgrm_id )
{
- int i_index;
- pgrm_descriptor_t* p_pgrm;
-
- ASSERT(p_stream);
+ int i_index, i_pgrm_index;
+ pgrm_descriptor_t * p_pgrm;
+
+ ASSERT( p_stream );
- /* Find where is described this program */
- for(i_index = 0; i_index < p_stream->i_pgrm_number; i_index++)
+ /* Find where this program is described */
+ for( i_index = 0; i_index < p_stream->i_pgrm_number; i_index++ )
{
if( p_stream->ap_programs[i_index]->i_number == i_pgrm_id )
{
- /* Here we are */
- p_pgrm = p_stream->ap_programs[i_index];
+ i_pgrm_index = i_index;
+ p_pgrm = p_stream->ap_programs[ i_pgrm_index ];
break;
}
}
- /* Free the structures that describes the es that belongs to that program */
+ /* Free the structures that describe the es that belongs to that program */
for( i_index = 0; i_index < p_pgrm->i_es_number; i_index++ )
- DestroyESDescr(p_input, p_pgrm, p_pgrm->ap_es[i_index]->i_id);
+ {
+ DestroyESDescr( p_input, p_pgrm, p_pgrm->ap_es[i_index]->i_id );
+ }
/* Free the table of es descriptors */
free( p_pgrm->ap_es );
/* Free the description of this stream */
free( p_pgrm );
- /* Remove this program from he list of programs of the stream */
+ /* Remove this program from the stream's list of programs */
p_stream->i_pgrm_number--;
- p_stream->ap_programs[i_index] = p_stream->ap_programs[p_stream->i_pgrm_number];
- p_stream->ap_programs = realloc(p_stream->ap_programs, p_stream->i_pgrm_number);
+ p_stream->ap_programs[ i_pgrm_index ] = p_stream->ap_programs[ p_stream->i_pgrm_number ];
+ p_stream->ap_programs = realloc( p_stream->ap_programs, p_stream->i_pgrm_number * sizeof(pgrm_descriptor_t *) );
}
-
/******************************************************************************
* AddESDescr:
******************************************************************************
return p_es;
}
-
-
/******************************************************************************
* DestroyESDescr:
******************************************************************************