1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-25 08:12:17 +00:00

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
This commit is contained in:
reimar 2004-12-18 14:06:35 +00:00
parent 93ef31d3d1
commit c632e897a8
3 changed files with 23 additions and 1 deletions

View File

@ -253,7 +253,8 @@ csp_again:
if(vo_flags&VFCAP_FLIPPED) flip^=1;
if(flip && !(vo_flags&VFCAP_FLIP)){
// we need to flip, but no flipping filter avail.
sh->vfilter=vf=vf_open_filter(vf,"flip",NULL);
vf_add_before_vo(&vf, "flip", NULL);
sh->vfilter = vf;
}
// time to do aspect ratio corrections...

View File

@ -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){

View File

@ -77,6 +77,7 @@ mp_image_t* vf_get_image(vf_instance_t* vf, unsigned int outfmt, int mp_imgtype,
vf_instance_t* vf_open_plugin(vf_info_t** filter_list, vf_instance_t* next, char *name, char **args);
vf_instance_t* vf_open_filter(vf_instance_t* next, char *name, char **args);
vf_instance_t* vf_add_before_vo(vf_instance_t **vf, char *name, char **args);
vf_instance_t* vf_open_encoder(vf_instance_t* next, char *name, char *args);
unsigned int vf_match_csp(vf_instance_t** vfp,unsigned int* list,unsigned int preferred);