summaryrefslogtreecommitdiffstats
path: root/stream
diff options
context:
space:
mode:
authorvoroshil <voroshil@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-09-01 18:49:51 +0000
committervoroshil <voroshil@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-09-01 18:49:51 +0000
commita108787e0067d2b5faed0d945ec50a6dd46be4c0 (patch)
treef850a35163e2f605c0b2110edaf647466fedd46c /stream
parentbe450f82930cc5bc0c8ae65981f1dac7d0bcbd92 (diff)
downloadmpv-a108787e0067d2b5faed0d945ec50a6dd46be4c0.tar.bz2
mpv-a108787e0067d2b5faed0d945ec50a6dd46be4c0.tar.xz
Make sure that no pages will left in cache during
channel switch (immediately stop decoding of vbi buffer when clear_cache is called). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24321 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'stream')
-rw-r--r--stream/tvi_vbi.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/stream/tvi_vbi.c b/stream/tvi_vbi.c
index 77d77de994..aa493a7eb7 100644
--- a/stream/tvi_vbi.c
+++ b/stream/tvi_vbi.c
@@ -149,6 +149,7 @@ typedef struct {
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 inline tt_page* get_from_cache(priv_vbi_t* priv, int pagenum,int subpagen
static void clear_cache(priv_vbi_t* priv){
int i;
tt_page* tp;
+ priv->cache_reset=1;
+
for(i=0;i<VBI_MAX_PAGES;i++){
while(priv->ptt_cache[i]){
tp=priv->ptt_cache[i];
@@ -1447,7 +1450,7 @@ static void vbi_decode(priv_vbi_t* priv,unsigned char*buf){
int d0,d1;
int i=0;
mp_msg(MSGT_TV,MSGL_DBG3,"vbi: vbi_decode\n");
- for(linep=buf; linep<buf+priv->ptsp->bufsize; linep+=priv->ptsp->samples_per_line,i++){
+ for(linep=buf; !priv->cache_reset && linep<buf+priv->ptsp->bufsize; linep+=priv->ptsp->samples_per_line,i++){
#if 0
/*
This routine is alternative implementation of raw VBI data decoding.
@@ -1487,6 +1490,11 @@ static void vbi_decode(priv_vbi_t* priv,unsigned char*buf){
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));
+ }
}