changeset 24345:388ac5e95da1

More accurate calculating of teletext page update intervals
author voroshil
date Sat, 08 Sep 2007 10:04:08 +0000
parents 09d402672398
children 9fb68e85180a
files stream/tvi_vbi.c
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/stream/tvi_vbi.c	Sat Sep 08 09:48:43 2007 +0000
+++ b/stream/tvi_vbi.c	Sat Sep 08 10:04:08 2007 +0000
@@ -153,6 +153,7 @@
     int           cache_reset;
     /// "page changed" flag: 0-unchanged, 1-entire page, 3-only header
     int           page_changed;
+    int           last_rendered;
 } priv_vbi_t;
 
 static unsigned char fixParity[256];
@@ -1836,9 +1837,10 @@
         return TVI_CONTROL_TRUE;
     case TV_VBI_CONTROL_MARK_UNCHANGED:
         priv->page_changed=0;
+        priv->last_rendered=GetTimerMS();
         return TVI_CONTROL_TRUE;
     case TV_VBI_CONTROL_IS_CHANGED:
-        if((GetTimerMS()/250)%2)  //forcing page update every 1/4 sec
+        if(GetTimerMS()-priv->last_rendered> 250)  //forcing page update every 1/4 sec
             priv->page_changed=3; //mark that header update is enough
         *(int*)arg=priv->page_changed;
         return TVI_CONTROL_TRUE;