From 0f155921b046c9e6cfed3fe601aa891c2d2a8b16 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 19 Aug 2012 18:01:30 +0200 Subject: core: manage tracks in the frontend Introduce a general track struct for every audio/video/subtitle track known to the frontend. External files (subtitles) are now represented as tracks too. This mainly serves to clean up the subtitle selection code: now every subtitle is simply a track, instead of using a messy numbering that goes by subtitle type (as it was stored in the global_sub_pos field). The mplayer fontend will list external subtitle files as additional tracks. The timeline code now tries to match the exact demuxer IDs of all tracks. This may cause problems when Matroska files with different track numberings are used with EDL timelines. Change demux_lavf not to set demuxer IDs, since most time they are not set. --- sub/av_sub.c | 5 +++++ sub/av_sub.h | 1 + sub/sub.c | 3 ++- 3 files changed, 8 insertions(+), 1 deletion(-) (limited to 'sub') diff --git a/sub/av_sub.c b/sub/av_sub.c index 56acfc63ca..dbf349133f 100644 --- a/sub/av_sub.c +++ b/sub/av_sub.c @@ -24,6 +24,11 @@ #include "spudec.h" #include "av_sub.h" +bool is_av_sub(int type) +{ + return type == 'b' || type == 'p' || type == 'x'; +} + void reset_avsub(struct sh_sub *sh) { if (sh->context) { diff --git a/sub/av_sub.h b/sub/av_sub.h index af3edc4d34..ee6205c87d 100644 --- a/sub/av_sub.h +++ b/sub/av_sub.h @@ -26,5 +26,6 @@ struct sh_sub; void reset_avsub(struct sh_sub *sh); int decode_avsub(struct sh_sub *sh, uint8_t *data, int size, double pts, double endpts); +bool is_av_sub(int type); #endif /* MPLAYER_AV_SUB_H */ diff --git a/sub/sub.c b/sub/sub.c index 4d4d91ea86..67413c936e 100644 --- a/sub/sub.c +++ b/sub/sub.c @@ -289,7 +289,8 @@ void osd_draw_text_ext(struct osd_state *osd, int dxs, int dys, if(obj->flags&OSDFLAG_VISIBLE){ switch(obj->type){ case OSDTYPE_SPU: - vo_draw_spudec_sub(obj, draw_alpha, ctx); // FIXME + if (vo_spudec) + vo_draw_spudec_sub(obj, draw_alpha, ctx); // FIXME break; case OSDTYPE_OSD: case OSDTYPE_SUBTITLE: -- cgit v1.2.3