core: disable vf_sub auto-insertion

Since most VOs support rendering subs directly, this doesn't change
much. Changes include: vo_null is faster, vo_image doesn't add subtitles
by default (while vo_lavc does), vo_caca doesn't render subs (but you
couldn't read them anyway).
This commit is contained in:
wm4 2012-10-21 18:36:33 +02:00
parent 773668b6e8
commit 93b384a799
3 changed files with 1 additions and 48 deletions

View File

@ -150,8 +150,7 @@ libmpcodecs/:
vf_*.c and vf.c form the video filter chain. They are fed by the video
decoder, and output the filtered images to the VOs though vf_vo.c. By
default, no video filters (except vf_vo) are used, though sometimes
vf_sub.c is inserted for rendering subtitles, when the VO can't.
default, no video filters (except vf_vo) are used.
ad_*.c and dec_audio.c/ad.c handle audio decoding. The audio filter chain is
separately in libaf.

View File

@ -49,10 +49,6 @@ static const struct vf_priv_s {
unsigned int outfmt;
struct mp_csp_details csp;
// 1 = auto-added filter: insert only if chain does not support OSD already
// 0 = insert always
int auto_insert;
struct osd_state *osd;
struct mp_osd_res dim;
} vf_priv_dflt = {
@ -276,21 +272,12 @@ static const unsigned int fmt_list[] = {
static int vf_open(vf_instance_t *vf, char *args)
{
int flags;
vf->priv->outfmt = vf_match_csp(&vf->next, fmt_list, IMGFMT_YV12);
if (vf->priv->outfmt)
flags = vf_next_query_format(vf, vf->priv->outfmt);
if (!vf->priv->outfmt) {
uninit(vf);
return 0;
} else if (vf->priv->auto_insert && flags & VFCAP_OSD) {
uninit(vf);
return -1;
}
if (vf->priv->auto_insert)
mp_msg(MSGT_ASS, MSGL_INFO, "[sub] auto-open\n");
vf->config = config;
vf->query_format = query_format;
vf->uninit = uninit;
@ -303,7 +290,6 @@ static int vf_open(vf_instance_t *vf, char *args)
#define ST_OFF(f) M_ST_OFF(struct vf_priv_s, f)
static const m_option_t vf_opts_fields[] = {
{"auto", ST_OFF(auto_insert), CONF_TYPE_FLAG, 0, 0, 1, NULL},
{NULL, NULL, 0, 0, 0, 0, NULL}
};

View File

@ -2267,38 +2267,6 @@ int reinit_video_chain(struct MPContext *mpctx)
sh_video->vfilter = vf_open_filter(opts, NULL, "vo", vf_arg);
}
if (opts->ass_enabled) {
int i;
int insert = 1;
if (opts->vf_settings)
for (i = 0; opts->vf_settings[i].name; ++i)
if (strcmp(opts->vf_settings[i].name, "sub") == 0) {
insert = 0;
break;
}
if (insert) {
extern vf_info_t vf_info_sub;
const vf_info_t *sub_vfs[] = {
&vf_info_sub, NULL
};
char *vf_arg[] = {
"auto", "yes", NULL
};
int retcode = 0;
struct vf_instance *vf_sub = vf_open_plugin_noerr(opts, sub_vfs,
sh_video->vfilter,
"sub", vf_arg,
&retcode);
if (vf_sub)
sh_video->vfilter = vf_sub;
else if (retcode == -1) // vf_sub open() returns -1 VO has OSD
mp_msg(MSGT_CPLAYER, MSGL_V, "[sub] vf_sub not needed\n");
else
mp_msg(MSGT_CPLAYER, MSGL_ERR,
"sub: cannot add video filter\n");
}
}
sh_video->vfilter = append_filters(sh_video->vfilter, opts->vf_settings);
struct vf_instance *vf = sh_video->vfilter;