[MPlayer-cvslog] CVS: main/libmpcodecs vd.c, 1.80, 1.81 vf.c, 1.109, 1.110 vf.h, 1.25, 1.26

Reimar Döffinger CVS syncmail at mplayerhq.hu
Sat Dec 18 15:06:37 CET 2004


CVS change done by Reimar Döffinger CVS

Update of /cvsroot/mplayer/main/libmpcodecs
In directory mail:/var2/tmp/cvs-serv4937/libmpcodecs

Modified Files:
	vd.c vf.c vf.h 
Log Message:
add the flip filter at the end of the filter chain.
Fixes -vf pp -flip and the flip option in the Gui.


Index: vd.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vd.c,v
retrieving revision 1.80
retrieving revision 1.81
diff -u -r1.80 -r1.81
--- vd.c	1 Dec 2004 09:30:11 -0000	1.80
+++ vd.c	18 Dec 2004 14:06:35 -0000	1.81
@@ -253,7 +253,8 @@
     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...

Index: vf.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vf.c,v
retrieving revision 1.109
retrieving revision 1.110
diff -u -r1.109 -r1.110
--- vf.c	1 Dec 2004 09:30:11 -0000	1.109
+++ vf.c	18 Dec 2004 14:06:35 -0000	1.110
@@ -473,6 +473,26 @@
   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){

Index: vf.h
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vf.h,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- vf.h	1 Dec 2004 09:30:11 -0000	1.25
+++ vf.h	18 Dec 2004 14:06:35 -0000	1.26
@@ -77,6 +77,7 @@
 
 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);




More information about the MPlayer-cvslog mailing list