Commit e1e9e7b7 authored by Sam Hocevar's avatar Sam Hocevar

* ./plugins/spudec/spu_decoder.c: fixed endianness issue; subtitles colors

    should be OK now.
parent 04ca15f9
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* spu_decoder.c : spu decoder thread * spu_decoder.c : spu decoder thread
***************************************************************************** *****************************************************************************
* Copyright (C) 2000-2001 VideoLAN * Copyright (C) 2000-2001 VideoLAN
* $Id: spu_decoder.c,v 1.19 2002/05/12 20:56:34 massiot Exp $ * $Id: spu_decoder.c,v 1.20 2002/05/15 00:40:26 sam Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* Rudolf Cornelissen <rag.cornelissen@inter.nl.net> * Rudolf Cornelissen <rag.cornelissen@inter.nl.net>
...@@ -374,8 +374,6 @@ static int ParseControlSequences( spudec_thread_t *p_spudec, ...@@ -374,8 +374,6 @@ static int ParseControlSequences( spudec_thread_t *p_spudec,
u8 i_command; u8 i_command;
int i_date; int i_date;
/* Dummy stuff */
u8 *pi_color;
int i; int i;
/* XXX: temporary variables */ /* XXX: temporary variables */
...@@ -433,15 +431,18 @@ static int ParseControlSequences( spudec_thread_t *p_spudec, ...@@ -433,15 +431,18 @@ static int ParseControlSequences( spudec_thread_t *p_spudec,
if( p_spudec->p_config->p_demux_data && if( p_spudec->p_config->p_demux_data &&
*(int*)p_spudec->p_config->p_demux_data == 0xBeeF ) *(int*)p_spudec->p_config->p_demux_data == 0xBeeF )
{ {
u32 i_color;
p_spu->p_sys->b_palette = 1; p_spu->p_sys->b_palette = 1;
for( i = 0; i < 4 ; i++ ) for( i = 0; i < 4 ; i++ )
{ {
pi_color = (void*)p_spudec->p_config->p_demux_data i_color = ((u32*)((void*)p_spudec->p_config->
+ sizeof(int) + 4 * sizeof(u8) * p_demux_data + sizeof(int)))[
GetBits( &p_spudec->bit_stream, 4 ); GetBits(&p_spudec->bit_stream, 4) ];
p_spu->p_sys->pi_yuv[3-i][0] = pi_color[2];
p_spu->p_sys->pi_yuv[3-i][1] = pi_color[0]; p_spu->p_sys->pi_yuv[3-i][0] = (i_color>>16) & 0xff;
p_spu->p_sys->pi_yuv[3-i][2] = pi_color[1]; p_spu->p_sys->pi_yuv[3-i][1] = (i_color>>0) & 0xff;
p_spu->p_sys->pi_yuv[3-i][2] = (i_color>>8) & 0xff;
} }
} }
else else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment