stream/dvbin: do not forget channel list for multiply delivery systems

dvb_get_channels is expected to append to an existing channel list.
For adapters supporting many delivery systems, a subsequent channel list
may turn up with a non-existent channel config, and the pointer
to the previously parsed channel list may be lost
(i.e. the list will be leaked and no channels detected).
Fix this by passing through the existing list (which may be NULL)
in case no new channels are found.
This commit is contained in:
Oliver Freyermuth 2023-08-29 21:55:35 +02:00 committed by sfan5
parent d88e3d105a
commit 7021d095b1
1 changed files with 2 additions and 2 deletions

View File

@ -262,7 +262,7 @@ static dvb_channels_list_t *dvb_get_channels(struct mp_log *log,
char line[CHANNEL_LINE_LEN], *colon;
if (!filename)
return NULL;
return list;
int fields, cnt, k;
int has8192, has0;
@ -283,7 +283,7 @@ static dvb_channels_list_t *dvb_get_channels(struct mp_log *log,
filename, get_dvb_delsys(delsys));
if ((f = fopen(filename, "r")) == NULL) {
mp_fatal(log, "CAN'T READ CONFIG FILE %s\n", filename);
return NULL;
return list;
}
if (list == NULL) {