[vlc-devel] commit: Ugly hack to make the filter chain work correctly for the video output core . This will be removed once all the different picture release methods have been merged into one coherent method . (Antoine Cellerier )

git version control git at videolan.org
Wed Jun 4 13:13:52 CEST 2008


vlc | branch: master | Antoine Cellerier <dionoea at videolan.org> | Wed Jun  4 12:57:50 2008 +0200| [39eef2d3c94153157cafa65f8b655c19e6b80806]

Ugly hack to make the filter chain work correctly for the video output core. This will be removed once all the different picture release methods have been merged into one coherent method.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=39eef2d3c94153157cafa65f8b655c19e6b80806
---

 src/misc/filter_chain.c |   20 ++++++++++++++++++--
 1 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/src/misc/filter_chain.c b/src/misc/filter_chain.c
index 0d649f9..a86e031 100644
--- a/src/misc/filter_chain.c
+++ b/src/misc/filter_chain.c
@@ -277,6 +277,10 @@ const es_format_t *filter_chain_GetFmtOut( filter_chain_t *p_chain )
 /**
  * Apply the filter chain
  */
+
+/* FIXME This include is needed by the Ugly hack */
+#include <vlc_vout.h>
+
 picture_t *filter_chain_VideoFilter( filter_chain_t *p_chain, picture_t *p_pic )
 {
     int i;
@@ -284,9 +288,21 @@ picture_t *filter_chain_VideoFilter( filter_chain_t *p_chain, picture_t *p_pic )
     for( i = 0; i < p_chain->filters.i_count; i++ )
     {
         filter_t *p_filter = pp_filter[i];
-        p_pic = p_filter->pf_video_filter( p_filter, p_pic );
-        if( !p_pic )
+        picture_t *p_newpic = p_filter->pf_video_filter( p_filter, p_pic );
+        if( !p_newpic )
             return NULL;
+        /* FIXME Ugly hack to make it work in picture core.
+         * FIXME Remove this code when the picture release API has been
+         * FIXME cleaned up (a git revert of the commit should work) */
+        if( p_chain->p_this->i_object_type == VLC_OBJECT_VOUT )
+        {
+            if( p_pic->i_refcount )
+                p_pic->i_status = DISPLAYED_PICTURE;
+            else
+                p_pic->i_status = DESTROYED_PICTURE;
+            p_newpic->i_status = READY_PICTURE;
+        }
+        p_pic = p_newpic;
     }
     return p_pic;
 }




More information about the vlc-devel mailing list