dvbsrc: reflow switch case statement a bit

Make it clear there's no 'break' missing at the end
of the case SYS_DVBT, and pacify coverity (CID 1249689).
This commit is contained in:
Tim-Philipp Müller 2014-10-27 12:43:53 +00:00
parent 09f0b03762
commit 6505e84f7c

View file

@ -2395,29 +2395,31 @@ gst_dvbsrc_set_fe_params (GstDvbSrc * object, struct dtv_properties *props)
}
break;
case SYS_DVBT:
if (object->transmission_mode != TRANSMISSION_MODE_AUTO &&
object->transmission_mode != TRANSMISSION_MODE_2K &&
object->transmission_mode != TRANSMISSION_MODE_8K) {
GST_WARNING_OBJECT (object, "Wrong DVB-T parameter combination: "
"transmission mode should be either AUTO, 2K or 8K");
}
if (object->bandwidth != 6000000 && object->bandwidth != 7000000 &&
object->bandwidth != 8000000) {
GST_WARNING_OBJECT (object, "Wrong DVB-T parameter value: bandwidth "
"is %d but only 6, 7 and 8 MHz are allowed", object->bandwidth);
}
case SYS_DVBT2:
if (object->delsys != SYS_DVBT &&
object->transmission_mode != TRANSMISSION_MODE_AUTO &&
object->transmission_mode != TRANSMISSION_MODE_1K &&
object->transmission_mode != TRANSMISSION_MODE_2K &&
object->transmission_mode != TRANSMISSION_MODE_4K &&
object->transmission_mode != TRANSMISSION_MODE_8K &&
object->transmission_mode != TRANSMISSION_MODE_16K &&
object->transmission_mode != TRANSMISSION_MODE_32K) {
GST_WARNING_OBJECT (object, "Wrong DVB-T2 parameter combination: "
"transmission mode should be either AUTO, 1K, 2K, 4K, 8K, 16K "
"or 32K");
if (object->delsys == SYS_DVBT) {
if (object->transmission_mode != TRANSMISSION_MODE_AUTO &&
object->transmission_mode != TRANSMISSION_MODE_2K &&
object->transmission_mode != TRANSMISSION_MODE_8K) {
GST_WARNING_OBJECT (object, "Wrong DVB-T parameter combination: "
"transmission mode should be either AUTO, 2K or 8K");
}
if (object->bandwidth != 6000000 && object->bandwidth != 7000000 &&
object->bandwidth != 8000000) {
GST_WARNING_OBJECT (object, "Wrong DVB-T parameter value: bandwidth "
"is %d but only 6, 7 and 8 MHz are allowed", object->bandwidth);
}
} else if (object->delsys == SYS_DVBT2) {
if (object->transmission_mode != TRANSMISSION_MODE_AUTO &&
object->transmission_mode != TRANSMISSION_MODE_1K &&
object->transmission_mode != TRANSMISSION_MODE_2K &&
object->transmission_mode != TRANSMISSION_MODE_4K &&
object->transmission_mode != TRANSMISSION_MODE_8K &&
object->transmission_mode != TRANSMISSION_MODE_16K &&
object->transmission_mode != TRANSMISSION_MODE_32K) {
GST_WARNING_OBJECT (object, "Wrong DVB-T2 parameter combination: "
"transmission mode should be either AUTO, 1K, 2K, 4K, 8K, 16K "
"or 32K");
}
}
set_prop (props->props, &n, DTV_BANDWIDTH_HZ, object->bandwidth);
set_prop (props->props, &n, DTV_CODE_RATE_HP, object->code_rate_hp);