summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2012-10-21 18:36:33 +0200
committerwm4 <wm4@nowhere>2012-10-24 21:56:34 +0200
commit93b384a799ff23836700989db771735ff2df68ca (patch)
tree783895fcd87d76b2ed88f0c1906ca1bd14bcd71f
parent773668b6e85d4da4d252cb4ad8abd50448d70c7c (diff)
downloadmpv-93b384a799ff23836700989db771735ff2df68ca.tar.bz2
mpv-93b384a799ff23836700989db771735ff2df68ca.tar.xz
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).
-rw-r--r--DOCS/tech-overview.txt3
-rw-r--r--libmpcodecs/vf_sub.c14
-rw-r--r--mplayer.c32
3 files changed, 1 insertions, 48 deletions
diff --git a/DOCS/tech-overview.txt b/DOCS/tech-overview.txt
index f52601f970..d407b92caa 100644
--- a/DOCS/tech-overview.txt
+++ b/DOCS/tech-overview.txt
@@ -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.
diff --git a/libmpcodecs/vf_sub.c b/libmpcodecs/vf_sub.c
index e377d589c5..78f75221cb 100644
--- a/libmpcodecs/vf_sub.c
+++ b/libmpcodecs/vf_sub.c
@@ -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}
};
diff --git a/mplayer.c b/mplayer.c
index de85ec2c33..6963471c0e 100644
--- a/mplayer.c
+++ b/mplayer.c
@@ -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;