sys/dvb/gstdvbsrc.c: Post bus message with dvb read failure when unable to read from...
authorZaheer Abbas Merali <zaheerabbas@merali.org>
Tue, 23 Dec 2008 15:26:30 +0000 (15:26 +0000)
committerZaheer Abbas Merali <zaheerabbas@merali.org>
Tue, 23 Dec 2008 15:26:30 +0000 (15:26 +0000)
Original commit message from CVS:
* sys/dvb/gstdvbsrc.c:
Post bus message with dvb read failure when unable to read from
device.

ChangeLog
sys/dvb/gstdvbsrc.c

index fd1f5f5..913b48d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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>
index 0bbaba1..6a57029 100644 (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;