When there are multiple PID_* entries in the channels file, keep all of them instead of only the last one. Signed-off-by: Simon Arlott <v4l@xxxxxxxxxxx> --- lib/libdvbv5/dvb-file.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/lib/libdvbv5/dvb-file.c b/lib/libdvbv5/dvb-file.c index 866e4c6c..68265f4e 100644 --- a/lib/libdvbv5/dvb-file.c +++ b/lib/libdvbv5/dvb-file.c @@ -670,21 +670,18 @@ static int fill_entry(struct dvb_entry *entry, char *key, char *value) if (!type) return 0; - len = 0; - p = strtok(value," \t"); if (!p) return 0; while (p) { entry->other_el_pid = realloc(entry->other_el_pid, - (len + 1) * + (entry->other_el_pid_len + 1) * sizeof (*entry->other_el_pid)); - entry->other_el_pid[len].type = type; - entry->other_el_pid[len].pid = atol(p); + entry->other_el_pid[entry->other_el_pid_len].type = type; + entry->other_el_pid[entry->other_el_pid_len].pid = atol(p); p = strtok(NULL, " \t\n"); - len++; + entry->other_el_pid_len++; } - entry->other_el_pid_len = len; } if (!is_video && !is_audio) { -- 2.17.1 -- Simon Arlott