mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-27 11:32:51 +00:00
dvbsrc: Handle failure to get statistics from the device
Check the ioctl return value and don't output bogus values. CID #206016
This commit is contained in:
parent
c947e820cf
commit
012b5b8d4a
1 changed files with 8 additions and 5 deletions
|
@ -1453,11 +1453,14 @@ gst_dvbsrc_output_frontend_stats (GstDvbSrc * src)
|
|||
GstStructure *structure;
|
||||
int fe_fd = src->fd_frontend;
|
||||
|
||||
ioctl (fe_fd, FE_READ_STATUS, &status);
|
||||
ioctl (fe_fd, FE_READ_SIGNAL_STRENGTH, &_signal);
|
||||
ioctl (fe_fd, FE_READ_SNR, &snr);
|
||||
ioctl (fe_fd, FE_READ_BER, &ber);
|
||||
ioctl (fe_fd, FE_READ_UNCORRECTED_BLOCKS, &uncorrected_blocks);
|
||||
if (ioctl (fe_fd, FE_READ_STATUS, &status) ||
|
||||
ioctl (fe_fd, FE_READ_SIGNAL_STRENGTH, &_signal) ||
|
||||
ioctl (fe_fd, FE_READ_SNR, &snr) ||
|
||||
ioctl (fe_fd, FE_READ_BER, &ber) ||
|
||||
ioctl (fe_fd, FE_READ_UNCORRECTED_BLOCKS, &uncorrected_blocks)) {
|
||||
GST_WARNING_OBJECT (src, "Failed to get statistics from the device");
|
||||
return;
|
||||
}
|
||||
|
||||
structure = gst_structure_new ("dvb-frontend-stats", "status", G_TYPE_INT,
|
||||
status, "signal", G_TYPE_INT, _signal, "snr", G_TYPE_INT, snr,
|
||||
|
|
Loading…
Reference in a new issue