sys/dvb/gstdvbsrc.c: Post bus message with dvb read failure when unable to read from device.

Original commit message from CVS:
* sys/dvb/gstdvbsrc.c:
Post bus message with dvb read failure when unable to read from
device.
This commit is contained in:
Zaheer Abbas Merali 2008-12-23 15:26:30 +00:00
parent 382bbcbd2b
commit ef7d946e23
2 changed files with 13 additions and 2 deletions

View file

@ -1,3 +1,9 @@
2008-12-23 Zaheer Abbas Merali <zaheerabbas at merali dot org>
* sys/dvb/gstdvbsrc.c:
Post bus message with dvb read failure when unable to read from
device.
2008-12-23 Wim Taymans <wim.taymans@collabora.co.uk>
Patch by: Luotao Fu <l dot fu at pengutronix dot de>

View file

@ -860,7 +860,8 @@ gst_dvbsrc_plugin_init (GstPlugin * plugin)
}
static GstBuffer *
read_device (int fd, int adapter_number, int frontend_number, int size)
read_device (int fd, int adapter_number, int frontend_number, int size,
GstDvbSrc * object)
{
int count = 0;
struct pollfd pfd[1];
@ -911,6 +912,10 @@ read_device (int fd, int adapter_number, int frontend_number, int size)
GST_WARNING
("Unable to read after %u attempts from device: /dev/dvb/adapter%d/dvr%d (%d)",
attempts, adapter_number, frontend_number, errno);
gst_element_post_message (GST_ELEMENT_CAST (object),
gst_message_new_element (GST_OBJECT (object),
gst_structure_empty_new ("dvb-read-failure")));
}
} else if (errno == -EINTR) { // poll interrupted
;
@ -944,7 +949,7 @@ gst_dvbsrc_create (GstPushSrc * element, GstBuffer ** buf)
/* --- Read TS from DVR device --- */
GST_DEBUG_OBJECT (object, "Reading from DVR device");
*buf = read_device (object->fd_dvr, object->adapter_number,
object->frontend_number, buffer_size);
object->frontend_number, buffer_size, object);
if (*buf != NULL) {
GstCaps *caps;