if (ioctl (fd, FE_GET_PROPERTY, &props) < 0)
{
msg_Err (d->obj, "cannot enumerate frontend systems: %m");
- return 0;
+ goto legacy;
}
static const unsigned systab[] = {
msg_Dbg (d->obj, " system %u", sys);
systems |= systab[sys];
}
+
+ return systems;
+legacy:
+ props.num = 1;
#else
struct dtv_property prop[1] = {
{ .cmd = DTV_API_VERSION },
.num = 1,
.props = prop
};
-
+ unsigned systems = 0;
+#endif
if (ioctl (fd, FE_GET_PROPERTY, &props) < 0)
{
msg_Err (d->obj, "unsupported kernel DVB version 3 or older (%m)");
msg_Dbg (d->obj, "probing frontend (kernel API v%u.%u, user API v%u.%u)",
prop[0].u.data >> 8, prop[0].u.data & 0xFF,
DVB_API_VERSION, DVB_API_VERSION_MINOR);
+#if !DVBv5(5)
+ /* Some delivery systems cannot be detected without the DVB API v5.5.
+ * To run correctly on recent kernels (Linux >= 3.3),
+ * VLC needs to be compiled with up-to-date kernel headers. */
+ if ((prop[0].u.data >> 8) > 5
+ || ((prop[0].u.data >> 8) == 5 && (prop[0].u.data & 0xFF) >= 5))
+ msg_Err (d->obj, "obsolete user API version running on a new kernel");
+ msg_Info (d->obj, "please recompile "PACKAGE_NAME" "PACKAGE_VERSION);
+#endif
struct dvb_frontend_info info;
if (ioctl (fd, FE_GET_INFO, &info) < 0)
{
info.symbol_rate_min, info.symbol_rate_max);
msg_Dbg (d->obj, " (%"PRIu32" tolerance)", info.symbol_rate_tolerance);
- unsigned systems;
-
/* DVB first generation and ATSC */
switch (info.type)
{
case FE_OFDM: systems = DVB_T; break;
case FE_ATSC: systems = ATSC | CQAM; break;
default:
- systems = 0;
msg_Err (d->obj, "unknown frontend type %u", info.type);
}
/* ISDB (only terrestrial before DVBv5.5) */
if (info.type == FE_OFDM)
systems |= ISDB_T;
-#endif
+
return systems;
}