Exemple #1
0
void ts_pmt_Del( demux_t *p_demux, ts_pmt_t *pmt )
{
    if( dvbpsi_decoder_present( pmt->handle ) )
        dvbpsi_pmt_detach( pmt->handle );
    dvbpsi_delete( pmt->handle );
    for( int i=0; i<pmt->e_streams.i_size; i++ )
        PIDRelease( p_demux, pmt->e_streams.p_elems[i] );
    ARRAY_RESET( pmt->e_streams );
    if( pmt->p_mgt )
        PIDRelease( p_demux, pmt->p_mgt );
    if( pmt->iod )
        ODFree( pmt->iod );
    for( int i=0; i<pmt->od.objects.i_size; i++ )
        ODFree( pmt->od.objects.p_elems[i] );
    ARRAY_RESET( pmt->od.objects );
    if( pmt->i_number > -1 )
        es_out_Control( p_demux->out, ES_OUT_DEL_GROUP, pmt->i_number );
    free( pmt );
}
Exemple #2
0
void parse::process_pat(const decoded_pat_t *decoded_pat)
{
	dprintf("()");
	for (map_decoded_pat_programs::const_iterator iter = decoded_pat->programs.begin();
	     iter != decoded_pat->programs.end(); ++iter)
		if (iter->first > 0) {// FIXME: > 0 ???
			if ((!service_ids.size()) || (service_ids.count(iter->first)))  {
#if USING_DVBPSI_VERSION_0
				h_pmt[iter->second] = dvbpsi_AttachPMT(iter->first, take_pmt, this);
#else
				if (h_pmt.count(iter->second)) {
					if (dvbpsi_decoder_present(h_pmt[iter->second].get_handle()))
						dvbpsi_pmt_detach(h_pmt[iter->second].get_handle());
					h_pmt.erase(iter->second);
				}

				if (!dvbpsi_decoder_present(h_pmt[iter->second].get_handle()))
					dvbpsi_pmt_attach(h_pmt[iter->second].get_handle(), iter->first, take_pmt, this);
#endif
				add_filter(iter->second);
				rcvd_pmt[iter->first] = false;
			}
		}
}