The patch number 1214 was added via Christoph Pfister <[EMAIL PROTECTED]>
to http://linuxtv.org/hg/dvb-apps master development tree.

If anyone has any objections, please let us know by sending a message to:
        [EMAIL PROTECTED]

------

gnutv: fix bogus errno check and survive dvr overflows
based on a patch by Andrea
http://www.linuxtv.org/pipermail/linux-dvb/2008-July/027176.html


---

 util/gnutv/gnutv_data.c |   22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)

diff -r 8457d7c5e4b3 -r 363d557af25b util/gnutv/gnutv_data.c
--- a/util/gnutv/gnutv_data.c   Fri Jul 18 22:57:52 2008 +0200
+++ b/util/gnutv/gnutv_data.c   Fri Jul 18 23:23:07 2008 +0200
@@ -220,19 +220,27 @@ static void *fileoutputthread_func(void*
        pollfd.events = POLLIN|POLLPRI|POLLERR;
 
        while(!outputthread_shutdown) {
-               if (poll(&pollfd, 1, 1000) != 1)
+               if (poll(&pollfd, 1, 1000) == -1) {
+                       if (errno == EINTR)
+                               continue;
+                       fprintf(stderr, "DVR device poll failure\n");
+                       return 0;
+               }
+
+               if (pollfd.revents == 0)
                        continue;
-               if (pollfd.revents & POLLERR) {
-                       if (errno == EINTR)
-                               continue;
-                       fprintf(stderr, "DVR device read failure\n");
-                       return 0;
-               }
 
                int size = read(dvrfd, buf, sizeof(buf));
                if (size < 0) {
                        if (errno == EINTR)
                                continue;
+
+                       if (errno == EOVERFLOW) {
+                               // The error flag has been cleared, next read 
should succeed.
+                               fprintf(stderr, "DVR overflow\n");
+                               continue;
+                       }
+
                        fprintf(stderr, "DVR device read failure\n");
                        return 0;
                }


---

Patch is available at: 
http://linuxtv.org/hg/dvb-apps/rev/363d557af25bf4a5121075103be07b996aa16a1c

_______________________________________________
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to