From 1198f65d0b69cd6c78781e12f355a95ef15b3086 Mon Sep 17 00:00:00 2001
From: cehoyos <cehoyos@b3059339-0415-0410-9bf9-f77b7e298cf2>
Date: Sat, 24 Oct 2009 13:19:20 +0000
Subject: [PATCH] Fix teletext character set auto-detection.

Patch by Francesco Lavra, francescolavra interfree it


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29796 b3059339-0415-0410-9bf9-f77b7e298cf2
---
 stream/tvi_vbi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/stream/tvi_vbi.c b/stream/tvi_vbi.c
index 2be0d99d07..a2aa530f7a 100644
--- a/stream/tvi_vbi.c
+++ b/stream/tvi_vbi.c
@@ -1107,7 +1107,7 @@ static int decode_pkt0(priv_vbi_t* priv,unsigned char* data,int magAddr)
     if(priv->primary_language)
         priv->mag[magAddr].pt->primary_lang=priv->primary_language;
     else
-        priv->mag[magAddr].pt->primary_lang= (d[7]&7)>>1;
+        priv->mag[magAddr].pt->primary_lang= (d[7]>>1)&7;
     priv->mag[magAddr].pt->secondary_lang=priv->secondary_language;
     priv->mag[magAddr].pt->subpagenum=(d[2]|(d[3]<<4)|(d[4]<<8)|(d[5]<<12))&0x3f7f;
     priv->mag[magAddr].pt->pagenum=(magAddr<<8) | d[0] | (d[1]<<4);