Commit 48d5e912 authored by Jean-Paul Saman's avatar Jean-Paul Saman

dvbinfo: PMT use correct cleanup function

PMT are attached by using dvbpsi_pmt_attach() function directly and not through
a demuxing chain, so release the PMT's in the same manner. Thus using the
function dvbpsi_pmt_detach() directly.
parent e3e1828f
...@@ -759,7 +759,7 @@ static void handle_PAT(void* p_data, dvbpsi_pat_t* p_pat) ...@@ -759,7 +759,7 @@ static void handle_PAT(void* p_data, dvbpsi_pat_t* p_pat)
p_pmt->p_next = NULL; p_pmt->p_next = NULL;
/* PMT table_id == 0x02 and extenion == 0x0 */ /* PMT table_id == 0x02 and extenion == 0x0 */
if (!dvbpsi_pmt_attach(p_pmt->handle, 0x02, 0x0, if (!dvbpsi_pmt_attach(p_pmt->handle, 0x02, 0x00,
p_program->i_number, handle_PMT, p_stream)) p_program->i_number, handle_PMT, p_stream))
{ {
fprintf(stderr, "dvbinfo: Failed to attach new pmt decoder\n"); fprintf(stderr, "dvbinfo: Failed to attach new pmt decoder\n");
...@@ -2546,8 +2546,7 @@ void libdvbpsi_exit(ts_stream_t *stream) ...@@ -2546,8 +2546,7 @@ void libdvbpsi_exit(ts_stream_t *stream)
while (p_pmt) while (p_pmt)
{ {
dvbpsi_t *handle = p_pmt->handle; dvbpsi_t *handle = p_pmt->handle;
if (!dvbpsi_chain_demux_delete(handle)) dvbpsi_pmt_detach(handle, 0x02, 0x0);
fprintf(stderr, "dvbinfo: failed to delete PMT decoder chain! .. possibly leaking memory!!\n");
dvbpsi_delete(p_pmt->handle); dvbpsi_delete(p_pmt->handle);
stream->i_pmt--; stream->i_pmt--;
......
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