summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorZaheer Abbas Merali <zaheerabbas@merali.org>2008-01-23 14:59:47 +0000
committerZaheer Abbas Merali <zaheerabbas@merali.org>2008-01-23 14:59:47 +0000
commit1d20eee27741502ac03073bd66ad3d3792127295 (patch)
tree1edc146963a3afd5cb9348f23833ca14ad799cfc /sys
parent0cc0c6df9aba1c8b022e33ab4e22175fe7a7b4fa (diff)
downloadgst-plugins-bad-1d20eee27741502ac03073bd66ad3d3792127295.tar.gz
gst-plugins-bad-1d20eee27741502ac03073bd66ad3d3792127295.tar.bz2
gst-plugins-bad-1d20eee27741502ac03073bd66ad3d3792127295.zip
sys/dvb/gstdvbsrc.c: Do not go on forever if problem with reading from dvr, rather return NULL.
Original commit message from CVS: * sys/dvb/gstdvbsrc.c: Do not go on forever if problem with reading from dvr, rather return NULL. Handle some cleanup issues of closing filedescriptors when failing to tune or similar.
Diffstat (limited to 'sys')
-rw-r--r--sys/dvb/gstdvbsrc.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/dvb/gstdvbsrc.c b/sys/dvb/gstdvbsrc.c
index 7b40c0ba..003e2299 100644
--- a/sys/dvb/gstdvbsrc.c
+++ b/sys/dvb/gstdvbsrc.c
@@ -877,6 +877,9 @@ read_device (int fd, int adapter_number, int frontend_number, int size)
("Unable to read after %u attempts from device: /dev/dvb/adapter%d/dvr%d (%d)",
attempts, adapter_number, frontend_number, errno);
}
+ if (attempts % 100 == 0) {
+ return NULL;
+ }
} else if (errno == -EINTR) { // poll interrupted
;
}
@@ -942,13 +945,20 @@ gst_dvbsrc_start (GstBaseSrc * bsrc)
gst_dvbsrc_open_frontend (src);
if (!gst_dvbsrc_tune (src)) {
GST_ERROR_OBJECT (src, "Not able to lock on to the dvb channel");
+ close (src->fd_frontend);
return FALSE;
}
if (!gst_dvbsrc_frontend_status (src)) {
+ /* unset filters also */
+ gst_dvbsrc_unset_pes_filters (src);
+ close (src->fd_frontend);
return FALSE;
}
if (!gst_dvbsrc_open_dvr (src)) {
GST_ERROR_OBJECT (src, "Not able to open dvr_device");
+ /* unset filters also */
+ gst_dvbsrc_unset_pes_filters (src);
+ close (src->fd_frontend);
return FALSE;
}