From 672b5df411d55e7069cbcd45d9fd513561ed4996 Mon Sep 17 00:00:00 2001 From: Oliver Freyermuth Date: Mon, 5 Jan 2015 23:46:31 +0100 Subject: stream_dvb: Do not add special PIDs if we anyways record the full TP. This just exchanges two blocks of code: If we record the full transponder, no need to explicitly add some PIDs to the filter list. --- stream/stream_dvb.c | 45 ++++++++++++++++++++++----------------------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/stream/stream_dvb.c b/stream/stream_dvb.c index a78ccd7eb3..f8122ecd0e 100644 --- a/stream/stream_dvb.c +++ b/stream/stream_dvb.c @@ -369,29 +369,6 @@ static dvb_channels_list *dvb_get_channels(struct mp_log *log, int cfg_full_tran if((fields < 2) || (ptr->pids_cnt <= 0) || (ptr->freq == 0) || (strlen(ptr->name) == 0)) continue; - has8192 = has0 = 0; - for(cnt = 0; cnt < ptr->pids_cnt; cnt++) - { - if(ptr->pids[cnt] == 8192) - has8192 = 1; - if(ptr->pids[cnt] == 0) - has0 = 1; - } - /* 8192 is the pseudo-PID for full TP dump, - enforce that if requested. */ - if (!has8192 && cfg_full_transponder) { - has8192 = 1; - } - if(has8192) { - ptr->pids[0] = 8192; - ptr->pids_cnt = 1; - } - else if(! has0) - { - ptr->pids[ptr->pids_cnt] = 0; //PID 0 is the PAT - ptr->pids_cnt++; - } - /* Add some PIDs which are mandatory in DVB, * and contain human-readable helpful data. */ @@ -414,6 +391,28 @@ static dvb_channels_list *dvb_get_channels(struct mp_log *log, int cfg_full_tran ptr->pids_cnt++; } + has8192 = has0 = 0; + for(cnt = 0; cnt < ptr->pids_cnt; cnt++) + { + if(ptr->pids[cnt] == 8192) + has8192 = 1; + if(ptr->pids[cnt] == 0) + has0 = 1; + } + + /* 8192 is the pseudo-PID for full TP dump, + enforce that if requested. */ + if (!has8192 && cfg_full_transponder) { + has8192 = 1; + } + if (has8192) { + ptr->pids[0] = 8192; + ptr->pids_cnt = 1; + } else if (!has0) { + ptr->pids[ptr->pids_cnt] = 0; //PID 0 is the PAT + ptr->pids_cnt++; + } + mp_verbose(log, " PIDS: "); for(cnt = 0; cnt < ptr->pids_cnt; cnt++) mp_verbose(log, " %d ", ptr->pids[cnt]); -- cgit v1.2.3