static gboolean gst_dvbsrc_start (GstBaseSrc * bsrc) { GstDvbSrc *src = GST_DVBSRC (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; } return TRUE; }
static gboolean gst_dvbsrc_start (GstBaseSrc * bsrc) { GstDvbSrc *src = GST_DVBSRC (bsrc); gst_dvbsrc_open_frontend (src, TRUE); 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; } if (!(src->poll = gst_poll_new (TRUE))) { GST_ELEMENT_ERROR (src, RESOURCE, OPEN_READ_WRITE, (NULL), ("could not create an fdset: %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); } return TRUE; }