summaryrefslogtreecommitdiffstats
path: root/sub/dec_sub.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-12-26 18:34:18 +0100
committerwm4 <wm4@nowhere>2015-12-26 18:34:18 +0100
commit8d4a179c144cb3e36762b2c3cef55d1d3bb9f951 (patch)
tree324adbf40a378eff49bad45dfdc56dbf2bf4972c /sub/dec_sub.c
parentce8524cb479f3b3339c6d2b3e0f5a45051145204 (diff)
downloadmpv-8d4a179c144cb3e36762b2c3cef55d1d3bb9f951.tar.bz2
mpv-8d4a179c144cb3e36762b2c3cef55d1d3bb9f951.tar.xz
sub: always recreate ASS_Renderer on subtitle decoder reinit
This includes the case of switching ordered chapter boundaries. It will now be recreated on each timeline part switch. This shouldn't be much of a problem with modern libass. (Older libass versions use fontconfig for memory fonts, and will be very slow to reinitialize memory fonts.)
Diffstat (limited to 'sub/dec_sub.c')
-rw-r--r--sub/dec_sub.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/sub/dec_sub.c b/sub/dec_sub.c
index e29b5bf220..0449fe8d05 100644
--- a/sub/dec_sub.c
+++ b/sub/dec_sub.c
@@ -80,6 +80,7 @@ struct dec_sub *sub_create(struct mpv_global *global)
sub->log = mp_log_new(sub, global->log, "sub");
sub->opts = global->opts;
sub->init_sd.opts = sub->opts;
+ sub->init_sd.global = global;
mpthread_mutex_init_recursive(&sub->lock);
@@ -119,17 +120,6 @@ void sub_set_video_fps(struct dec_sub *sub, double fps)
pthread_mutex_unlock(&sub->lock);
}
-void sub_set_ass_renderer(struct dec_sub *sub, struct ass_library *ass_library,
- struct ass_renderer *ass_renderer,
- pthread_mutex_t *ass_lock)
-{
- pthread_mutex_lock(&sub->lock);
- sub->init_sd.ass_library = ass_library;
- sub->init_sd.ass_renderer = ass_renderer;
- sub->init_sd.ass_lock = ass_lock;
- pthread_mutex_unlock(&sub->lock);
-}
-
static int sub_init_decoder(struct dec_sub *sub, struct sd *sd)
{
sd->driver = NULL;
@@ -150,7 +140,7 @@ static int sub_init_decoder(struct dec_sub *sub, struct sd *sd)
return 0;
}
-void sub_init_from_sh(struct dec_sub *sub, struct sh_stream *sh)
+void sub_init(struct dec_sub *sub, struct demuxer *demuxer, struct sh_stream *sh)
{
assert(!sub->sd);
assert(sh && sh->sub);
@@ -160,6 +150,7 @@ void sub_init_from_sh(struct dec_sub *sub, struct sh_stream *sh)
sub->sh = sh;
struct sd init_sd = sub->init_sd;
+ init_sd.demuxer = demuxer;
init_sd.sh = sh;
struct sd *sd = talloc(NULL, struct sd);