diff options
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | sys/dvb/gstdvbsrc.c | 10 |
2 files changed, 18 insertions, 0 deletions
@@ -1,3 +1,11 @@ +2008-01-23 Zaheer Abbas Merali <zaheerabbas at merali dot org> + + * 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. + 2008-01-23 Christian Schaller <christian.schaller@collabora.co.uk> * gst/rawparse/Makefile.am: Add missing header files to noinst_headers 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; } |