dvbsrc: add DVB-S2 sub-stream ID check
authorReynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com>
Fri, 20 May 2016 20:57:45 +0000 (13:57 -0700)
committerReynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com>
Fri, 20 May 2016 20:57:45 +0000 (13:57 -0700)
Disable if invalid (> 255) instead of blindy setting this
property regardless of its actual value.

sys/dvb/gstdvbsrc.c

index 4492d04..9ac6e39 100644 (file)
@@ -2549,6 +2549,11 @@ gst_dvbsrc_set_fe_params (GstDvbSrc * object, struct dtv_properties *props)
         set_prop (props->props, &n, DTV_MODULATION, object->modulation);
 
       if (object->delsys == SYS_DVBS2) {
+        if (object->stream_id > 255) {
+          GST_WARNING_OBJECT (object, "Invalid (> 255) DVB-S2 stream ID '%d'. "
+              "Disabling sub-stream filtering", object->stream_id);
+          object->stream_id = NO_STREAM_ID_FILTER;
+        }
         set_prop (props->props, &n, DTV_PILOT, object->pilot);
         set_prop (props->props, &n, DTV_ROLLOFF, object->rolloff);
         set_prop (props->props, &n, DTV_STREAM_ID, object->stream_id);