From 86689f7bf23dd05b5e6b9e42e43379d52e27c338 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 15 Mar 2014 22:17:51 +0100 Subject: demux_libass: change how external ASS subtitles are loaded Instead of parsing the ASS file in demux_libass.c and trying to pass the ASS_Track to the subtitle renderer, just read all file data in demux_libass.c, and let the subtitle renderer pass the file contents to ass_process_codec_private(). (This happens to parse full files too.) Makes the code simpler, though it also relies harder on the (messy) probe logic in demux_libass.c. --- sub/sd_ass.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'sub/sd_ass.c') diff --git a/sub/sd_ass.c b/sub/sd_ass.c index e4428516b9..4ae7121bad 100644 --- a/sub/sd_ass.c +++ b/sub/sd_ass.c @@ -68,13 +68,9 @@ static int init(struct sd *sd) ctx->is_converted = sd->converted_from != NULL; - if (sd->ass_track) { - ctx->ass_track = sd->ass_track; - } else { - ctx->ass_track = ass_new_track(sd->ass_library); - if (!ctx->is_converted) - ctx->ass_track->track_type = TRACK_TYPE_ASS; - } + ctx->ass_track = ass_new_track(sd->ass_library); + if (!ctx->is_converted) + ctx->ass_track->track_type = TRACK_TYPE_ASS; if (sd->extradata) { ass_process_codec_private(ctx->ass_track, sd->extradata, @@ -310,8 +306,7 @@ static void uninit(struct sd *sd) { struct sd_ass_priv *ctx = sd->priv; - if (sd->ass_track != ctx->ass_track) - ass_free_track(ctx->ass_track); + ass_free_track(ctx->ass_track); talloc_free(ctx); } -- cgit v1.2.3