From 02ce316ade9ba932ad405383278d6b01c54e5fc4 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 1 Jun 2013 19:44:12 +0200 Subject: 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. --- demux/stheader.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'demux/stheader.h') diff --git a/demux/stheader.h b/demux/stheader.h index 09e9d8682b..8220d65a61 100644 --- a/demux/stheader.h +++ b/demux/stheader.h @@ -161,11 +161,10 @@ typedef struct sh_video { typedef struct sh_sub { SH_COMMON - bool active; // after track switch decoder may stay initialized, not active unsigned char *extradata; // extra header data passed from demuxer int extradata_len; struct ass_track *track; // loaded by libass - const struct sd_functions *sd_driver; + struct dec_sub *dec_sub; // decoder context } sh_sub_t; // demuxer.c: -- cgit v1.2.3