[MPlayer-dev-eng] [PATCH] teletext links

Vladimir Voroshilov voroshil at gmail.com
Tue Aug 28 16:11:50 CEST 2007


Hi

2007/8/28, Ötvös Attila <oattila at chello.hu>:
> Hi All!
>
> This patch implement - packet 27 - teletext links.
>

>+static int decode_pkt27_page(priv_vbi_t* priv,unsigned char*data,int magAddr){

"decode_pkt27" for consistance with other code

>+        priv->mag[magAddr].pt->links[i].pagenum = data[1+i*6] & 0xf |
>+                (data[2+i*6] & 0xf) << 4 | hpg;

Additional parentheses required.

>+        priv->mag[magAddr].pt->links[i].subpagenum = (data[3+i*6] & 0xf |
>+                (data[4+i*6] & 0xf) << 4 | (data[5+i*6] & 0xf) << 8 |
>+                (data[6+i*6] & 0xf) << 12) & 0x3f7f;

Same here

+    put_to_cache(priv,priv->mag[magAddr].pt,-1);
+}

"return 1" missed

+    case TV_VBI_CONTROL_GO_LINK:
+    {
+        int val=*(int *) arg;
+        if(val<1 || val>6)
+            return TVI_CONTROL_FALSE;
+        pthread_mutex_lock(&(priv->buffer_mutex));
+        if (!(pgc = priv->ptt_cache[priv->pagenum])) {
+            pthread_mutex_unlock(&(priv->buffer_mutex));
+            return TVI_CONTROL_FALSE;
+        }
+        if (!pgc->links[val-1].pagenum || pgc->links[val-1].pagenum>0x7ff) {
+            pthread_mutex_unlock(&(priv->buffer_mutex));
+            return TVI_CONTROL_FALSE;
+        }
+        priv->pagenum=pgc->links[val-1].pagenum;
+        priv->subpagenum=get_subpagenum_from_cache(priv,priv->pagenum);

i've added here check for special code 0x3f7f - "no subpage specified"



You also forgot to add entry into slave.txt

Applied with above changes.

-- 
Regards,
Vladimir Voroshilov     mailto:voroshil at gmail.com
JID: voroshil at gmail.com, voroshil at jabber.ru
ICQ: 95587719



More information about the MPlayer-dev-eng mailing list