changeset 24763:5d7f6e5e0847

After receiving EINTR 'read' syscall should be restarted. Fixes receiving teletext on some systems. Modified patch from Oldrich Jedlicka oldium dot pro at aenam dot cz
author voroshil
date Tue, 16 Oct 2007 01:53:34 +0000
parents 1ed81edfac75
children fbf46414bb48
files stream/tvi_v4l.c stream/tvi_v4l2.c
diffstat 2 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/stream/tvi_v4l.c	Mon Oct 15 17:46:17 2007 +0000
+++ b/stream/tvi_v4l.c	Tue Oct 16 01:53:34 2007 +0000
@@ -867,6 +867,8 @@
 
     while (!priv->vbi_shutdown){
         bytes=read(priv->vbi_fd,buf,tsp.bufsize);
+        if(bytes<0 && errno==EINTR)
+            continue;
         if (bytes!=tsp.bufsize){
             mp_msg(MSGT_TV,MSGL_WARN,"vbi: expecting bytes: %d, got: %d",tsp.bufsize,bytes);
             break;
--- a/stream/tvi_v4l2.c	Mon Oct 15 17:46:17 2007 +0000
+++ b/stream/tvi_v4l2.c	Tue Oct 16 01:53:34 2007 +0000
@@ -662,6 +662,8 @@
 
     while (!priv->vbi_shutdown){
         bytes=read(priv->vbi_fd,buf,tsp.bufsize);	
+        if(bytes<0 && errno==EINTR)
+            continue;
 	if (bytes!=tsp.bufsize){
 	    mp_msg(MSGT_TV,MSGL_WARN,"vbi: expecting bytes: %d, got: %d\n",tsp.bufsize,bytes);
 	    break;