[MPlayer-dev-eng] [PATCH] fix stubs to teletext

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Tue Aug 14 17:00:25 CEST 2007


Hello,
> + * Based on aletv of Edgar Toernig the fix stubs [soc:eoc] was happened.

I'd say something like
"Code for calculating soc/eoc is based on aletv by Edgar Toernig"
The "was happened" does sound funny though ;-)

> @@ -278,8 +279,15 @@
>  
>      priv->bpb=(priv->ptsp->sampling_rate/6937500.0)*ONE_FIXP+0.5;
>  //FIXME: STUBS!!!!

The FIXME should probably be removed?

> -    priv->soc=0;
> -    priv->eoc=92;
> +    priv->soc=(int)(9.2e-6*priv->ptsp->sampling_rate)-(int)priv->ptsp->offset;
> +    priv->eoc=(int)(12.9e-6*priv->ptsp->sampling_rate)-(int)priv->ptsp->offset;

priv->ptsp->offset is already int, so the cast there is useless. And
since this code is not speed-critical, there is no need for the first
cast either.

> +    if (priv->soc<0) priv->soc=0;

IMO use priv->soc = FFMAX(priv->soc, 0);

> +    if (priv->eoc>priv->ptsp->samples_per_line-(int)(43*8*priv->bpb/ONE_FIXP))
> +        priv->eoc=priv->ptsp->samples_per_line-(int)(43*8*priv->bpb/ONE_FIXP);

The cast is not needed.
Also better use FFMIN, that avoids having to write the calculation
twice.

> +    if (priv->eoc-priv->soc < (int)(16*priv->bpb/ONE_FIXP)) {

This cast is not needed either.

> @@ -912,18 +920,14 @@
>      unsigned char min,max;
>      int thr=0; //threshold
>  
> -    //stubs
> -    int soc=0;
> -    int eoc=92;

I'd leave that part as it was in your first patch (i.e. leaving the
variables in but just changing them to priv->soc etc.

Greetings,
Reimar Döffinger



More information about the MPlayer-dev-eng mailing list