mirror of
https://github.com/mpv-player/mpv
synced 2025-02-27 19:01:07 +00:00
sub: simplify code by always defining sub_cp
This commit is contained in:
parent
adde96a814
commit
a78bb28ed6
@ -565,9 +565,7 @@ const m_option_t common_opts[] = {
|
||||
|
||||
OPT_STRINGLIST("sub", sub_name, 0),
|
||||
OPT_PATHLIST("sub-paths", sub_paths, 0),
|
||||
#ifdef CONFIG_ICONV
|
||||
{"subcp", &sub_cp, CONF_TYPE_STRING, 0, 0, 0, NULL},
|
||||
#endif
|
||||
{"subdelay", &sub_delay, CONF_TYPE_FLOAT, 0, 0.0, 10.0, NULL},
|
||||
{"subfps", &sub_fps, CONF_TYPE_FLOAT, 0, 0.0, 10.0, NULL},
|
||||
OPT_MAKE_FLAGS("autosub", sub_auto, 0),
|
||||
|
@ -908,11 +908,7 @@ void add_subtitles(struct MPContext *mpctx, char *filename, float fps,
|
||||
|
||||
#ifdef CONFIG_ASS
|
||||
if (opts->ass_enabled) {
|
||||
#ifdef CONFIG_ICONV
|
||||
asst = mp_ass_read_stream(mpctx->ass_library, filename, sub_cp);
|
||||
#else
|
||||
asst = mp_ass_read_stream(mpctx->ass_library, filename, 0);
|
||||
#endif
|
||||
is_native_ass = asst;
|
||||
if (!asst) {
|
||||
subd = sub_read_file(filename, fps, &mpctx->opts);
|
||||
|
@ -38,10 +38,6 @@
|
||||
#include "stream/stream.h"
|
||||
#include "options.h"
|
||||
|
||||
#ifndef CONFIG_ICONV
|
||||
static char *sub_cp = 0;
|
||||
#endif
|
||||
|
||||
ASS_Track *mp_ass_default_track(ASS_Library *library, struct MPOpts *opts)
|
||||
{
|
||||
ASS_Track *track = ass_new_track(library);
|
||||
|
@ -45,9 +45,11 @@
|
||||
|
||||
#ifdef CONFIG_ICONV
|
||||
#include <iconv.h>
|
||||
char *sub_cp=NULL;
|
||||
#endif
|
||||
|
||||
char *sub_cp=NULL;
|
||||
|
||||
|
||||
int suboverlap_enabled = 1;
|
||||
|
||||
// Parameter struct for the format-specific readline functions
|
||||
|
Loading…
Reference in New Issue
Block a user