From ea7c0981ec6a15d19d47c3ef59c24dfb3957ad6e Mon Sep 17 00:00:00 2001 From: "Reynaldo H. Verdejo Pinochet" Date: Mon, 6 Jun 2016 16:35:15 -0700 Subject: [PATCH] dvbsrc: unify exit paths on _start() --- sys/dvb/gstdvbsrc.c | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/sys/dvb/gstdvbsrc.c b/sys/dvb/gstdvbsrc.c index 76e9ebf2f5..45adba8c41 100644 --- a/sys/dvb/gstdvbsrc.c +++ b/sys/dvb/gstdvbsrc.c @@ -1985,32 +1985,29 @@ gst_dvbsrc_start (GstBaseSrc * bsrc) } if (!gst_dvbsrc_tune (src)) { GST_ERROR_OBJECT (src, "Not able to lock on to the dvb channel"); - gst_dvbsrc_unset_pes_filters (src); - close (src->fd_frontend); - return FALSE; + goto fail; } 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; + goto fail; } if (!(src->poll = gst_poll_new (TRUE))) { GST_ELEMENT_ERROR (src, RESOURCE, OPEN_READ_WRITE, (NULL), ("Could not create an fd set: %s (%d)", g_strerror (errno), errno)); - /* unset filters also */ - gst_dvbsrc_unset_pes_filters (src); - close (src->fd_frontend); - return FALSE; - } else { - gst_poll_fd_init (&src->poll_fd_dvr); - src->poll_fd_dvr.fd = src->fd_dvr; - gst_poll_add_fd (src->poll, &src->poll_fd_dvr); - gst_poll_fd_ctl_read (src->poll, &src->poll_fd_dvr, TRUE); + goto fail; } + gst_poll_fd_init (&src->poll_fd_dvr); + src->poll_fd_dvr.fd = src->fd_dvr; + gst_poll_add_fd (src->poll, &src->poll_fd_dvr); + gst_poll_fd_ctl_read (src->poll, &src->poll_fd_dvr, TRUE); + return TRUE; + +fail: + gst_dvbsrc_unset_pes_filters (src); + close (src->fd_frontend); + return FALSE; } static gboolean