# HG changeset patch # User voroshil # Date 1188672591 0 # Node ID 15d547dfa66bcb7d40396305c045007ea378b54e # Parent 4ad15f9bff3b0657018d6a13ef49d4f010b761dc Make sure that no pages will left in cache during channel switch (immediately stop decoding of vbi buffer when clear_cache is called). diff -r 4ad15f9bff3b -r 15d547dfa66b stream/tvi_vbi.c --- a/stream/tvi_vbi.c Sat Sep 01 15:56:19 2007 +0000 +++ b/stream/tvi_vbi.c Sat Sep 01 18:49:51 2007 +0000 @@ -149,6 +149,7 @@ unsigned int juliandate; unsigned int universaltime; unsigned char networkname[21]; + int cache_reset; } priv_vbi_t; static unsigned char fixParity[256]; @@ -622,6 +623,8 @@ static void clear_cache(priv_vbi_t* priv){ int i; tt_page* tp; + priv->cache_reset=1; + for(i=0;iptt_cache[i]){ tp=priv->ptt_cache[i]; @@ -1447,7 +1450,7 @@ int d0,d1; int i=0; mp_msg(MSGT_TV,MSGL_DBG3,"vbi: vbi_decode\n"); - for(linep=buf; linepptsp->bufsize; linep+=priv->ptsp->samples_per_line,i++){ + for(linep=buf; !priv->cache_reset && linepptsp->bufsize; linep+=priv->ptsp->samples_per_line,i++){ #if 0 /* This routine is alternative implementation of raw VBI data decoding. @@ -1487,6 +1490,11 @@ mp_msg(MSGT_TV,MSGL_DBG3,"unsupported packet:%d\n",pkt); } } + if (priv->cache_reset){ + pthread_mutex_lock(&(priv->buffer_mutex)); + priv->cache_reset=0; + pthread_mutex_unlock(&(priv->buffer_mutex)); + } }