changeset 24305:414b72437fe3

Increase number of skipped buffers to 5 to avoid mixing teletext pages from different channels during channel switch.
author voroshil
date Sun, 02 Sep 2007 06:12:32 +0000
parents 032c82a7a053
children 35bdf0b2a043
files stream/tvi_vbi.c
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/stream/tvi_vbi.c	Sat Sep 01 21:35:07 2007 +0000
+++ b/stream/tvi_vbi.c	Sun Sep 02 06:12:32 2007 +0000
@@ -623,8 +623,12 @@
 static void clear_cache(priv_vbi_t* priv){
     int i;
     tt_page* tp;
-    priv->cache_reset=1;
     
+    /*
+      Skip next 5 buffers to avoid mixing teletext pages from different
+      channels during channel switch
+    */
+    priv->cache_reset=5;
     for(i=0;i<VBI_MAX_PAGES;i++){
         while(priv->ptt_cache[i]){
             tp=priv->ptt_cache[i];
@@ -1492,7 +1496,7 @@
     }
     if (priv->cache_reset){
         pthread_mutex_lock(&(priv->buffer_mutex));
-        priv->cache_reset=0;
+        priv->cache_reset--;
         pthread_mutex_unlock(&(priv->buffer_mutex));
     }