summaryrefslogtreecommitdiffstats
path: root/stream
diff options
context:
space:
mode:
authorvoroshil <voroshil@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-08-22 14:01:57 +0000
committervoroshil <voroshil@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-08-22 14:01:57 +0000
commit65e0b2a95ede109a2b55329b373c4d16802f66b1 (patch)
tree4a01617cac1f2c82098228bf477013303f23a53e /stream
parentff4232804d3be70061fa947e0332ca501acd8e0d (diff)
downloadmpv-65e0b2a95ede109a2b55329b373c4d16802f66b1.tar.bz2
mpv-65e0b2a95ede109a2b55329b373c4d16802f66b1.tar.xz
Fix [soc:eoc] stubs.
Slightly modified patch from Otvos Attila oattila at chello dot hu git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24119 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'stream')
-rw-r--r--stream/tvi_vbi.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/stream/tvi_vbi.c b/stream/tvi_vbi.c
index 6d877d6899..b4ab05b667 100644
--- a/stream/tvi_vbi.c
+++ b/stream/tvi_vbi.c
@@ -22,6 +22,7 @@
* Based on Attila Otvos' teletext patch, Michael Niedermayer's
* proof-of-concept teletext capture utility and some parts
* (decode_raw_line_runin,pll_add,pll_reset) of MythTV project.
+ * Code for calculating [soc:eoc] is based on aletv of Edgar Toernig.
*
*
* Some implementation details:
@@ -277,10 +278,13 @@ static void init_vbi_consts(priv_vbi_t* priv){
}
priv->bpb=(priv->ptsp->sampling_rate/6937500.0)*ONE_FIXP+0.5;
-//FIXME: STUBS!!!!
- priv->soc=0;
- priv->eoc=92;
-//END STUBS!!!
+ priv->soc=FFMAX(9.2e-6*priv->ptsp->sampling_rate-priv->ptsp->offset, 0);
+ priv->eoc=FFMIN(12.9e-6*priv->ptsp->sampling_rate-priv->ptsp->offset,
+ priv->ptsp->samples_per_line-43*8*priv->bpb/ONE_FIXP);
+ if (priv->eoc - priv->soc<16*priv->bpb/ONE_FIXP){ // invalid [soc:eoc]
+ priv->soc=0;
+ priv->eoc=92;
+ };
priv->bp8bl=0.97*8*priv->bpb/ONE_FIXP; // -3% tolerance
priv->bp8bh=1.03*8*priv->bpb/ONE_FIXP; // +3% tolerance
}
@@ -913,8 +917,8 @@ static int decode_raw_line_runin(priv_vbi_t* priv,unsigned char* buf,unsigned ch
int thr=0; //threshold
//stubs
- int soc=0;
- int eoc=92;
+ int soc=priv->soc;
+ int eoc=priv->eoc;
for(i=soc;i<eoc;i++)
dt[i]=buf[i+priv->bpb/ONE_FIXP]-buf[i]; // amplifies the edges best.