[vlc-devel] commit: Fixed RGB colors when only RGB masks differ. (Laurent Aimar )
git version control
git at videolan.org
Tue Sep 9 20:52:43 CEST 2008
vlc | branch: 0.9-bugfix | Laurent Aimar <fenrir at videolan.org> | Mon Sep 8 22:43:37 2008 +0200| [06fc224582bece437b82b4d63fdc43e1acd8b199] | committer: Laurent Aimar
Fixed RGB colors when only RGB masks differ.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=06fc224582bece437b82b4d63fdc43e1acd8b199
---
src/video_output/video_output.c | 19 ++++++++++++++++++-
1 files changed, 18 insertions(+), 1 deletions(-)
diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 9e5fa6d..f8e1b47 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -58,6 +58,7 @@
#include "modules/modules.h"
#include <assert.h>
+#include "vout_pictures.h"
/*****************************************************************************
* Local prototypes
@@ -524,6 +525,22 @@ static void vout_Destructor( vlc_object_t * p_this )
static int ChromaCreate( vout_thread_t *p_vout );
static void ChromaDestroy( vout_thread_t *p_vout );
+static bool ChromaIsEqual( const picture_heap_t *p_output, const picture_heap_t *p_render )
+{
+ if( !vout_ChromaCmp( p_output->i_chroma, p_render->i_chroma ) )
+ return false;
+
+ if( p_output->i_chroma != FOURCC_RV15 &&
+ p_output->i_chroma != FOURCC_RV16 &&
+ p_output->i_chroma != FOURCC_RV24 &&
+ p_output->i_chroma != FOURCC_RV32 )
+ return true;
+
+ return p_output->i_rmask == p_render->i_rmask &&
+ p_output->i_gmask == p_render->i_gmask &&
+ p_output->i_bmask == p_render->i_bmask;
+}
+
static int InitThread( vout_thread_t *p_vout )
{
int i, i_aspect_x, i_aspect_y;
@@ -624,7 +641,7 @@ static int InitThread( vout_thread_t *p_vout )
* the render buffers, ie same size and chroma */
if( ( p_vout->output.i_width == p_vout->render.i_width )
&& ( p_vout->output.i_height == p_vout->render.i_height )
- && ( vout_ChromaCmp( p_vout->output.i_chroma, p_vout->render.i_chroma ) ) )
+ && ( ChromaIsEqual( &p_vout->output, &p_vout->render ) ) )
{
/* Cool ! We have direct buffers, we can ask the decoder to
* directly decode into them ! Map the first render buffers to
More information about the vlc-devel
mailing list