diff options
author | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2004-12-18 14:06:35 +0000 |
---|---|---|
committer | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2004-12-18 14:06:35 +0000 |
commit | c632e897a8fb4c0e266ceb1f059449d39189abd1 (patch) | |
tree | 6ad364eeb3eff90d5592d913ed2fb3779b062b44 /libmpcodecs/vf.c | |
parent | 93ef31d3d157ce70053f675819e89bd38cbd2f0a (diff) | |
download | mpv-c632e897a8fb4c0e266ceb1f059449d39189abd1.tar.bz2 mpv-c632e897a8fb4c0e266ceb1f059449d39189abd1.tar.xz |
add the flip filter at the end of the filter chain.
Fixes -vf pp -flip and the flip option in the Gui.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@14184 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs/vf.c')
-rw-r--r-- | libmpcodecs/vf.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/libmpcodecs/vf.c b/libmpcodecs/vf.c index 60108ed736..bd591163d6 100644 --- a/libmpcodecs/vf.c +++ b/libmpcodecs/vf.c @@ -473,6 +473,26 @@ vf_instance_t* vf_open_filter(vf_instance_t* next, char *name, char **args){ return vf_open_plugin(filter_list,next,name,args); } +/** + * \brief adds a filter before the last one (which should be the vo filter). + * \param vf start of the filter chain. + * \param name name of the filter to add. + * \param args argument list for the filter. + * \return pointer to the filter instance that was created. + */ +vf_instance_t* vf_add_before_vo(vf_instance_t **vf, char *name, char **args) { + vf_instance_t *vo, *prev = NULL, *new; + // Find the last filter (should be vf_vo) + for (vo = *vf; vo->next; vo = vo->next) + prev = vo; + new = vf_open_filter(vo, name, args); + if (prev) + prev->next = new; + else + *vf = new; + return new; +} + //============================================================================ unsigned int vf_match_csp(vf_instance_t** vfp,unsigned int* list,unsigned int preferred){ |