From 7c14959cf119c24660ced3c4cb5af51f15f8c3cb Mon Sep 17 00:00:00 2001 From: Laurent Aimar Date: Wed, 9 Jul 2008 19:03:18 +0000 Subject: [PATCH] Fixed asa decoder colors (on x86 at least). Can someone test on a big endian CPU (I don't know if it is CPU dependant) ? --- modules/codec/csri.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/codec/csri.c b/modules/codec/csri.c index 963e7d8647..26f4c18077 100644 --- a/modules/codec/csri.c +++ b/modules/codec/csri.c @@ -262,7 +262,8 @@ static subpicture_region_t *UpdateRegions( video_format_t *p_fmt, spu_t *p_spu, p_fmt->i_visible_width, p_fmt->i_visible_height, (const char*)&p_fmt->i_chroma ); #endif - + /* XXX On x86 at least our RGBA is mapped to their BGRA + * TODO confirm that is the same on big endian cpu */ fmt = *p_fmt; fmt.i_chroma = VLC_FOURCC('R','G','B','A'); fmt.i_width = fmt.i_visible_width; @@ -278,7 +279,7 @@ static subpicture_region_t *UpdateRegions( video_format_t *p_fmt, spu_t *p_spu, struct csri_fmt csri_fmt; memset(&csri_fmt, 0, sizeof(csri_fmt)); - csri_fmt.pixfmt = CSRI_F_RGBA; + csri_fmt.pixfmt = CSRI_F_BGRA; csri_fmt.width = fmt.i_width; csri_fmt.height = fmt.i_height; if( csri_request_fmt( p_sys->p_instance, &csri_fmt ) ) @@ -303,7 +304,7 @@ static subpicture_region_t *UpdateRegions( video_format_t *p_fmt, spu_t *p_spu, /* */ //msg_Dbg( p_dec, "TS %lf", ts * 0.000001 ); memset( &csri_frame, 0, sizeof(csri_frame) ); - csri_frame.pixfmt = CSRI_F_RGBA; + csri_frame.pixfmt = CSRI_F_BGRA; csri_frame.planes[0] = (unsigned char*)p_spu_region->picture.Y_PIXELS; csri_frame.strides[0] = p_spu_region->picture.Y_PITCH; csri_render( p_sys->p_instance, &csri_frame, ts * 0.000001 ); -- 2.39.2