# HG changeset patch # User reimar # Date 1346511185 0 # Node ID 99ac8595027792048e0f57b3fef728279c2e1654 # Parent 35fe96aedad58905e24e523a42b4a6b24b41c935 Support decoding teletext in the format that WTV uses. diff -r 35fe96aedad5 -r 99ac85950277 libmpcodecs/dec_teletext.c --- a/libmpcodecs/dec_teletext.c Sat Sep 01 14:47:50 2012 +0000 +++ b/libmpcodecs/dec_teletext.c Sat Sep 01 14:53:05 2012 +0000 @@ -1867,6 +1867,9 @@ 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; diff -r 35fe96aedad5 -r 99ac85950277 libmpcodecs/dec_teletext.h --- a/libmpcodecs/dec_teletext.h Sat Sep 01 14:47:50 2012 +0000 +++ b/libmpcodecs/dec_teletext.h Sat Sep 01 14:53:05 2012 +0000 @@ -70,6 +70,7 @@ #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 diff -r 35fe96aedad5 -r 99ac85950277 mpcommon.c --- a/mpcommon.c Sat Sep 01 14:47:50 2012 +0000 +++ b/mpcommon.c Sat Sep 01 14:53:05 2012 +0000 @@ -276,6 +276,15 @@ 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) {