[MPlayer-cvslog] r35138 - in trunk: libmpcodecs/dec_teletext.c libmpcodecs/dec_teletext.h mpcommon.c

reimar subversion at mplayerhq.hu
Sat Sep 1 16:53:05 CEST 2012


Author: reimar
Date: Sat Sep  1 16:53:05 2012
New Revision: 35138

Log:
Support decoding teletext in the format that WTV uses.

Modified:
   trunk/libmpcodecs/dec_teletext.c
   trunk/libmpcodecs/dec_teletext.h
   trunk/mpcommon.c

Modified: trunk/libmpcodecs/dec_teletext.c
==============================================================================
--- trunk/libmpcodecs/dec_teletext.c	Sat Sep  1 16:47:50 2012	(r35137)
+++ trunk/libmpcodecs/dec_teletext.c	Sat Sep  1 16:53:05 2012	(r35138)
@@ -1867,6 +1867,9 @@ int teletext_control(void* p, int cmd, v
     case TV_VBI_CONTROL_DECODE_PAGE:
         vbi_decode(priv,*(unsigned char**)arg);
         return VBI_CONTROL_TRUE;
+    case TV_VBI_CONTROL_DECODE_LINE:
+        vbi_decode_line(priv, arg);
+        return VBI_CONTROL_TRUE;
     case TV_VBI_CONTROL_DECODE_DVB:
         vbi_decode_dvb(priv, arg);
         return VBI_CONTROL_TRUE;

Modified: trunk/libmpcodecs/dec_teletext.h
==============================================================================
--- trunk/libmpcodecs/dec_teletext.h	Sat Sep  1 16:47:50 2012	(r35137)
+++ trunk/libmpcodecs/dec_teletext.h	Sat Sep  1 16:53:05 2012	(r35138)
@@ -70,6 +70,7 @@ int teletext_control(void* p, int cmd, v
 #define TV_VBI_CONTROL_DECODE_PAGE     0x556   ///< decode vbi page
 #define TV_VBI_CONTROL_GET_NETWORKNAME 0x557   ///< get current network name
 #define TV_VBI_CONTROL_DECODE_DVB      0x558   ///< decode DVB teletext
+#define TV_VBI_CONTROL_DECODE_LINE     0x559   ///< decode a single teletext line (format used by WTV)
 
 #define VBI_TFORMAT_TEXT    0               ///< text mode
 #define VBI_TFORMAT_BW      1               ///< black&white mode

Modified: trunk/mpcommon.c
==============================================================================
--- trunk/mpcommon.c	Sat Sep  1 16:47:50 2012	(r35137)
+++ trunk/mpcommon.c	Sat Sep  1 16:53:05 2012	(r35138)
@@ -276,6 +276,15 @@ void update_subtitles(sh_video_t *sh_vid
             if (type == 'd') {
                 if (d_dvdsub->demuxer->teletext) {
                     uint8_t *p = packet;
+                    if (len == 3124) { // wtv subtitle-only format
+                        while (len >= 42) {
+                            teletext_control(d_dvdsub->demuxer->teletext,
+                                TV_VBI_CONTROL_DECODE_LINE, p);
+                            p   += 42;
+                            len -= 42;
+                        }
+                        return;
+                    }
                     p++;
                     len--;
                     while (len >= 46) {


More information about the MPlayer-cvslog mailing list