diff options
author | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2009-11-10 11:31:47 +0000 |
---|---|---|
committer | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2009-11-10 11:31:47 +0000 |
commit | 9a8a73e547dd662bce82cfe52fde37dd7409f1d2 (patch) | |
tree | b6dd51d6090a0a23b7f8675ad94645980eae8b24 /mpcommon.c | |
parent | 1135e23dfc98a161a4da78519fa200f2c982a064 (diff) | |
download | mpv-9a8a73e547dd662bce82cfe52fde37dd7409f1d2.tar.bz2 mpv-9a8a73e547dd662bce82cfe52fde37dd7409f1d2.tar.xz |
Add support for DVB teletext.
Patch by Francesco Lavra [francescolavra interfree it] with modifications by me.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29875 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'mpcommon.c')
-rw-r--r-- | mpcommon.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/mpcommon.c b/mpcommon.c index 5e2f85a606..ba5e20db89 100644 --- a/mpcommon.c +++ b/mpcommon.c @@ -141,9 +141,15 @@ void update_subtitles(sh_video_t *sh_video, double refpts, demux_stream_t *d_dvd if (spudec_changed(vo_spudec)) vo_osd_changed(OSDTYPE_SPU); - } else if (dvdsub_id >= 0 && (type == 't' || type == 'm' || type == 'a')) { + } else if (dvdsub_id >= 0 && (type == 't' || type == 'm' || type == 'a' || type == 'd')) { double curpts = refpts + sub_delay; double endpts; + if (type == 'd' && !d_dvdsub->demuxer->teletext) { + tt_stream_props tsp = {0}; + void *ptr = &tsp; + if (teletext_control(NULL, TV_VBI_CONTROL_START, &ptr) == VBI_CONTROL_TRUE) + d_dvdsub->demuxer->teletext = ptr; + } if (d_dvdsub->non_interleaved) ds_get_next_pts(d_dvdsub); while (d_dvdsub->first) { @@ -157,6 +163,22 @@ void update_subtitles(sh_video_t *sh_video, double refpts, demux_stream_t *d_dvd len = FFMIN(len - 2, AV_RB16(packet)); packet += 2; } + if (type == 'd') { + if (d_dvdsub->demuxer->teletext) { + uint8_t *p = packet; + p++; + len--; + while (len >= 46) { + int sublen = p[1]; + if (p[0] == 2 || p[0] == 3) + teletext_control(d_dvdsub->demuxer->teletext, + TV_VBI_CONTROL_DECODE_DVB, p + 2); + p += sublen + 2; + len -= sublen + 2; + } + } + continue; + } #ifdef CONFIG_ASS if (ass_enabled) { sh_sub_t* sh = d_dvdsub->sh; |