summaryrefslogtreecommitdiffstats
path: root/player/main.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-10-03 22:32:16 +0200
committerwm4 <wm4@nowhere>2014-10-03 23:10:18 +0200
commitcc9973f4e0268bc17cf95ec39af194d0136e0c0d (patch)
treee0d65df5854f473ccc31ae13580ce64ec2b0d7db /player/main.c
parente64ce83182db230215ab547386b1ce310025423c (diff)
downloadmpv-cc9973f4e0268bc17cf95ec39af194d0136e0c0d.tar.bz2
mpv-cc9973f4e0268bc17cf95ec39af194d0136e0c0d.tar.xz
player: move some libass setup code to sub.c
Also recreate ASS_Library on every file played. This means we can move the code out of main.c as well. Recreating the ASS_Library object has no disadvantages, because it literally stores only the message callback, the (per-file) font attachment as byte arrays, and the set of style overrides. Hopefully this thing can be removed from the libass API entirely at some point. The only reason why the player core creates the ASS_Renderer, instead of the subtitle renderer, is because we want to cache the loaded fonts across ordered chapter transitions, so this probably still has to stay around for now.
Diffstat (limited to 'player/main.c')
-rw-r--r--player/main.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/player/main.c b/player/main.c
index 2a05d3b4f4..c5b0bd2800 100644
--- a/player/main.c
+++ b/player/main.c
@@ -53,7 +53,6 @@
#include "audio/mixer.h"
#include "demux/demux.h"
#include "stream/stream.h"
-#include "sub/ass_mp.h"
#include "sub/osd.h"
#include "video/decode/dec_video.h"
#include "video/out/vo.h"
@@ -134,11 +133,6 @@ void mp_destroy(struct MPContext *mpctx)
osd_free(mpctx->osd);
-#if HAVE_LIBASS
- if (mpctx->ass_library)
- ass_library_done(mpctx->ass_library);
-#endif
-
if (mpctx->opts->use_terminal && terminal_initialized) {
terminal_uninit();
terminal_initialized = false;
@@ -408,10 +402,7 @@ int mp_initialize(struct MPContext *mpctx)
if (opts->use_terminal && opts->consolecontrols && terminal_initialized)
terminal_setup_getch(mpctx->input);
-#if HAVE_LIBASS
- mpctx->ass_log = mp_log_new(mpctx, mpctx->global->log, "!libass");
- mpctx->ass_library = mp_ass_init(mpctx->global, mpctx->ass_log);
-#else
+#if !HAVE_LIBASS
MP_WARN(mpctx, "Compiled without libass.\n");
MP_WARN(mpctx, "There will be no OSD and no text subtitles.\n");
#endif