summaryrefslogtreecommitdiffstats
path: root/sub/sub.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-06-01 19:44:12 +0200
committerwm4 <wm4@nowhere>2013-06-01 19:44:16 +0200
commit02ce316ade9ba932ad405383278d6b01c54e5fc4 (patch)
tree4151e307fafc30a4079d4cd79c3d85d92df35105 /sub/sub.c
parent27d383918a3d63559c85ca96b2162a13234f2abc (diff)
downloadmpv-02ce316ade9ba932ad405383278d6b01c54e5fc4.tar.bz2
mpv-02ce316ade9ba932ad405383278d6b01c54e5fc4.tar.xz
sub: refactor
Make the sub decoder stuff independent from sh_sub (except for initialization of course). Sub decoders now access a struct sd only, instead of getting access to sh_sub. The glue code in dec_sub.c is similarily independent from osd. Some simplifications are made. For example, the switch_id stuff is unneeded: the frontend code just has to make sure to call osd_changed() any time subtitles are switched. This is also preparation for introducing subtitle converters. It's much cleaner to completely separate demuxer header/renderer glue/decoders for this purpose, especially since sub converters might completely change how demuxer headers have to be interpreted. Also pass data as demux_packets. Currently, this doesn't help much, but libavcodec converters might need scary stuff like packet side data, so it's perhaps better to go with passing packets.
Diffstat (limited to 'sub/sub.c')
-rw-r--r--sub/sub.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sub/sub.c b/sub/sub.c
index 9dc5722469..a0965dc1ec 100644
--- a/sub/sub.c
+++ b/sub/sub.c
@@ -159,11 +159,11 @@ static void render_object(struct osd_state *osd, struct osd_object *obj,
obj->vo_res = res;
if (obj->type == OSDTYPE_SUB) {
- if (osd->render_bitmap_subs) {
+ if (osd->render_bitmap_subs && osd->dec_sub) {
double sub_pts = video_pts;
if (sub_pts != MP_NOPTS_VALUE)
sub_pts -= osd->sub_offset;
- sub_get_bitmaps(osd, obj->vo_res, sub_pts, out_imgs);
+ sub_get_bitmaps(osd->dec_sub, obj->vo_res, sub_pts, out_imgs);
}
} else {
osd_object_get_bitmaps(osd, obj, out_imgs);