diff --git a/stream/stream_dvb.c b/stream/stream_dvb.c index e04bb73d06..aae9c9fd7a 100644 --- a/stream/stream_dvb.c +++ b/stream/stream_dvb.c @@ -351,7 +351,18 @@ static dvb_channels_list_t *dvb_get_channels(struct mp_log *log, vpid_str, apid_str, tpid_str, &ptr->service_id, &num_chars); - if (num_chars == strlen(&line[k])) { + bool is_vdr_conf = (num_chars == strlen(&line[k])); + mp_verbose(log, "This does look like a VDR style channel config file.\n"); + + // Special case: DVB-T style ZAP config also has 13 columns. + // Most columns should have non-numeric content, but some channel list generators insert 0 + // if a value is not used. However, INVERSION_* should always set after frequency. + if (is_vdr_conf && !strncmp(vdr_par_str, "INVERSION_", 10)) { + is_vdr_conf = false; + mp_verbose(log, "Found INVERSION field after frequency, assuming ZAP style channel config file.\n"); + } + + if (is_vdr_conf) { // Modulation parsed here, not via old xine-parsing path. mod[0] = '\0'; // It's a VDR-style config line. @@ -435,6 +446,7 @@ static dvb_channels_list_t *dvb_get_channels(struct mp_log *log, break; } } else { + // ZAP style channel config file. switch (delsys) { case SYS_DVBT: case SYS_DVBT2: