summaryrefslogtreecommitdiffstats
path: root/command.c
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2011-01-16 20:03:08 +0200
committerUoti Urpala <uau@glyph.nonexistent.invalid>2011-01-18 14:58:09 +0200
commite990fb2ffeaa786339895c8f3b3f104ef536bf39 (patch)
tree383aaa216cd5d1f7c4dd75f7c27cfbaadaa7970a /command.c
parent8636eb77c5f9f1e49a12e3e1653fe4c2e8e0bfc3 (diff)
downloadmpv-e990fb2ffeaa786339895c8f3b3f104ef536bf39.tar.bz2
mpv-e990fb2ffeaa786339895c8f3b3f104ef536bf39.tar.xz
subtitles: add framework for subtitle decoders
Add a framework for subtitle decoder modules that work more like audio/video decoders do, and change libass rendering of demuxed subtitles to use the new framework. The old subtitle code is messy, with details specific to handling particular subtitle types spread over high-level code. This should make it easier to clean things up and fix some bugs/limitations.
Diffstat (limited to 'command.c')
-rw-r--r--command.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/command.c b/command.c
index 5474b92fed..40ea205c00 100644
--- a/command.c
+++ b/command.c
@@ -32,6 +32,7 @@
#include "codec-cfg.h"
#include "mplayer.h"
#include "libvo/sub.h"
+#include "sub/dec_sub.h"
#include "m_option.h"
#include "m_property.h"
#include "m_config.h"
@@ -1656,6 +1657,7 @@ static int mp_property_sub(m_option_t *prop, int action, void *arg,
d_sub->id = -2;
}
mpctx->osd->ass_track = NULL;
+ uninit_player(mpctx, INITIALIZED_SUB);
if (source == SUB_SOURCE_VOBSUB) {
vobsub_id = vobsub_get_id_by_index(vo_vobsub, source_pos);
@@ -1690,10 +1692,10 @@ static int mp_property_sub(m_option_t *prop, int action, void *arg,
sh_sub_t *sh = d_sub->sh;
if (sh->type == 'v')
init_vo_spudec(mpctx);
-#ifdef CONFIG_ASS
- else if (opts->ass_enabled)
- mpctx->osd->ass_track = sh->ass_track;
-#endif
+ else {
+ sub_init(sh, mpctx->osd);
+ mpctx->initialized_flags |= INITIALIZED_SUB;
+ }
} else {
d_sub->id = -2;
d_sub->sh = NULL;