diff options
author | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2010-01-16 20:37:13 +0200 |
---|---|---|
committer | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2010-01-16 20:37:13 +0200 |
commit | 1f126fc60cdfb7eef4d42c1593aaaddda4935a37 (patch) | |
tree | 5c0d97c655415f0c0b4837d516205deb544ef44b /libmpcodecs/vf_ass.c | |
parent | 43c3a07f5812bfe32b1d65cced7f4d07213e1c72 (diff) | |
download | mpv-1f126fc60cdfb7eef4d42c1593aaaddda4935a37.tar.bz2 mpv-1f126fc60cdfb7eef4d42c1593aaaddda4935a37.tar.xz |
Avoid misleading error "ASS: cannot add video filter"
When using libass with a VO that has direct EOSD support the vf_ass
video filter is unnecessary and is not added automatically, but the
code that adds the filter when it is needed produced misleading output
messages in this case. The following two messages were printed at
MSGL_ERR level, making it look like an error condition:
Couldn't open video filter 'ass'.
ASS: cannot add video filter
Add a version of vf_open_plugin() called vf_open_plugin_noerr() that
does not itself print an error message if opening a vf fails and that
returns the exact status code returned by the vf open() function. Make
vf_ass return a different status code depending on whether there was
an actual error or if it determined a filter would be redundant. Use
the _noerr function in the code adding the filter to avoid the first
message and check the status code to avoid the second.
Diffstat (limited to 'libmpcodecs/vf_ass.c')
-rw-r--r-- | libmpcodecs/vf_ass.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libmpcodecs/vf_ass.c b/libmpcodecs/vf_ass.c index 5ea2f8b10d..9076ed099e 100644 --- a/libmpcodecs/vf_ass.c +++ b/libmpcodecs/vf_ass.c @@ -388,10 +388,12 @@ static int open(vf_instance_t *vf, char* args) 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 || (vf->priv->auto_insert && flags&VFCAP_EOSD)) - { + if (!vf->priv->outfmt) { uninit(vf); return 0; + } else if (vf->priv->auto_insert && flags&VFCAP_EOSD) { + uninit(vf); + return -1; } if (vf->priv->auto_insert) |