Mercurial > mplayer.hg
comparison mpcommon.c @ 29833:b06429c8c104
Add support for DVB teletext.
Patch by Francesco Lavra [francescolavra interfree it] with modifications by me.
author | reimar |
---|---|
date | Tue, 10 Nov 2009 11:31:47 +0000 |
parents | e255f9571156 |
children | 7119354805e7 |
comparison
equal
deleted
inserted
replaced
29832:07a96d936943 | 29833:b06429c8c104 |
---|---|
139 spudec_assemble(vo_spudec, packet, len, timestamp); | 139 spudec_assemble(vo_spudec, packet, len, timestamp); |
140 } | 140 } |
141 | 141 |
142 if (spudec_changed(vo_spudec)) | 142 if (spudec_changed(vo_spudec)) |
143 vo_osd_changed(OSDTYPE_SPU); | 143 vo_osd_changed(OSDTYPE_SPU); |
144 } else if (dvdsub_id >= 0 && (type == 't' || type == 'm' || type == 'a')) { | 144 } else if (dvdsub_id >= 0 && (type == 't' || type == 'm' || type == 'a' || type == 'd')) { |
145 double curpts = refpts + sub_delay; | 145 double curpts = refpts + sub_delay; |
146 double endpts; | 146 double endpts; |
147 if (type == 'd' && !d_dvdsub->demuxer->teletext) { | |
148 tt_stream_props tsp = {0}; | |
149 void *ptr = &tsp; | |
150 if (teletext_control(NULL, TV_VBI_CONTROL_START, &ptr) == VBI_CONTROL_TRUE) | |
151 d_dvdsub->demuxer->teletext = ptr; | |
152 } | |
147 if (d_dvdsub->non_interleaved) | 153 if (d_dvdsub->non_interleaved) |
148 ds_get_next_pts(d_dvdsub); | 154 ds_get_next_pts(d_dvdsub); |
149 while (d_dvdsub->first) { | 155 while (d_dvdsub->first) { |
150 double subpts = ds_get_next_pts(d_dvdsub); | 156 double subpts = ds_get_next_pts(d_dvdsub); |
151 if (subpts > curpts) | 157 if (subpts > curpts) |
154 len = ds_get_packet_sub(d_dvdsub, &packet); | 160 len = ds_get_packet_sub(d_dvdsub, &packet); |
155 if (type == 'm') { | 161 if (type == 'm') { |
156 if (len < 2) continue; | 162 if (len < 2) continue; |
157 len = FFMIN(len - 2, AV_RB16(packet)); | 163 len = FFMIN(len - 2, AV_RB16(packet)); |
158 packet += 2; | 164 packet += 2; |
165 } | |
166 if (type == 'd') { | |
167 if (d_dvdsub->demuxer->teletext) { | |
168 uint8_t *p = packet; | |
169 p++; | |
170 len--; | |
171 while (len >= 46) { | |
172 int sublen = p[1]; | |
173 if (p[0] == 2 || p[0] == 3) | |
174 teletext_control(d_dvdsub->demuxer->teletext, | |
175 TV_VBI_CONTROL_DECODE_DVB, p + 2); | |
176 p += sublen + 2; | |
177 len -= sublen + 2; | |
178 } | |
179 } | |
180 continue; | |
159 } | 181 } |
160 #ifdef CONFIG_ASS | 182 #ifdef CONFIG_ASS |
161 if (ass_enabled) { | 183 if (ass_enabled) { |
162 sh_sub_t* sh = d_dvdsub->sh; | 184 sh_sub_t* sh = d_dvdsub->sh; |
163 ass_track = sh ? sh->ass_track : NULL; | 185 ass_track = sh ? sh->ass_track : NULL; |