diff options
author | Reynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com> | 2016-05-15 00:41:12 -0700 |
---|---|---|
committer | Reynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com> | 2016-05-15 17:12:28 -0700 |
commit | 10b020095ba4a11834f919dfcaa5b154c6ea7bdf (patch) | |
tree | 6b8da9bde4cd9eb527a2da5b9317c98e1da6396c /sys/dvb/gstdvbsrc.c | |
parent | 378fdad1760e77996128716fb7612aed5ab7d5d5 (diff) | |
download | gstreamer-plugins-bad-10b020095ba4a11834f919dfcaa5b154c6ea7bdf.tar.gz |
dvbsrc: special case detection when DVB-T and T2 seem valid
There is no way to tell one over the other when parameters
seem valid for DVB-T and DVB-T2 and the adapter supports
both. Reason to go with the former here is that, from
experience, most DVB-T2 channels out there seem to use
parameters that are not valid for DVB-T, like QAM_256
https://bugzilla.gnome.org/show_bug.cgi?id=765731
Diffstat (limited to 'sys/dvb/gstdvbsrc.c')
-rw-r--r-- | sys/dvb/gstdvbsrc.c | 36 |
1 files changed, 26 insertions, 10 deletions
diff --git a/sys/dvb/gstdvbsrc.c b/sys/dvb/gstdvbsrc.c index eb6d6bd76..899a2fbd6 100644 --- a/sys/dvb/gstdvbsrc.c +++ b/sys/dvb/gstdvbsrc.c @@ -2404,16 +2404,32 @@ gst_dvbsrc_guess_delsys (GstDvbSrc * object) alternatives = g_list_length (valid); - if (!alternatives) { - GST_WARNING_OBJECT (object, "Delivery system autodetection provided no " - "valid alternative"); - candidate = g_list_last (object->supported_delsys); - } else { - if (alternatives > 1) { - GST_WARNING_OBJECT (object, "Delivery system autodetection provided more " - "than one valid alternative"); - } - candidate = g_list_last (valid); + switch (alternatives) { + case 0: + GST_WARNING_OBJECT (object, "Delivery system autodetection provided no " + "valid alternative"); + candidate = g_list_last (object->supported_delsys); + break; + case 1: + candidate = g_list_last (valid); + GST_DEBUG_OBJECT (object, "Delivery system autodetection provided only " + "one valid alternative: '%d'", GPOINTER_TO_INT (candidate->data)); + break; + default: + /* More than one alternative. Selection based on best guess */ + if (g_list_find (valid, GINT_TO_POINTER (SYS_DVBT)) && + g_list_find (valid, GINT_TO_POINTER (SYS_DVBT2))) { + /* There is no way to tell one over the other when parameters seem valid + * for DVB-T and DVB-T2 and the adapter supports both. Reason to go with + * the former here is that, from experience, most DVB-T2 channels out + * there seem to use parameters that are not valid for DVB-T, like + * QAM_256 */ + GST_WARNING_OBJECT (object, "Channel parameters valid for DVB-T and " + "DVB-T2. Choosing DVB-T"); + candidate = g_list_find (valid, GINT_TO_POINTER (SYS_DVBT)); + } else { + candidate = g_list_last (valid); + } } object->delsys = GPOINTER_TO_INT (candidate->data); |