From: Sam Hocevar Date: Tue, 23 Apr 2002 20:58:24 +0000 (+0000) Subject: * ./plugins/spudec/spu_decoder.c, ./plugins/dvd/dvd_es.c: temporary fix X-Git-Tag: 0.4.0~213 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=4b22a29123f0b58d5525f1a7f53712f597f25b6f;p=vlc * ./plugins/spudec/spu_decoder.c, ./plugins/dvd/dvd_es.c: temporary fix to avoid retrieving the spu palette from a network stream as if it was a DVD. --- diff --git a/ChangeLog b/ChangeLog index 7f2f92172d..800712a893 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,9 @@ HEAD + * ./plugins/spudec/spu_decoder.c, ./plugins/dvd/dvd_es.c: temporary fix + to avoid retrieving the spu palette from a network stream as if it was + a DVD. * ./src/interface/main.c: tidied the help output code. * ALL: removed underscores from option names and made a few options more self-explanatory, for instance --input_channel becomes --audio-channel; diff --git a/plugins/dvd/dvd_es.c b/plugins/dvd/dvd_es.c index c708558a67..e9a6d8255f 100644 --- a/plugins/dvd/dvd_es.c +++ b/plugins/dvd/dvd_es.c @@ -1,7 +1,7 @@ /* dvd_es.c: functions to find and select ES ***************************************************************************** * Copyright (C) 1998-2001 VideoLAN - * $Id: dvd_es.c,v 1.7 2002/04/23 14:16:20 sam Exp $ + * $Id: dvd_es.c,v 1.8 2002/04/23 20:58:23 sam Exp $ * * Author: Stéphane Borel * @@ -231,8 +231,10 @@ void DVDReadSPU( input_thread_t * p_input ) { ADDES( 0xbd, 0x20 + i_id, DVD_SPU_ES, SPU_ES, vts.manager_inf.p_spu_attr[i-1].i_lang_code, - 16*sizeof(u32) ); - memcpy( p_es->p_demux_data, palette, 16*sizeof(u32) ); + sizeof(int) + 16*sizeof(u32) ); + *(int*)p_es->p_demux_data = 0xBeeF; + memcpy( (void*)p_es->p_demux_data + sizeof(int), + palette, 16*sizeof(u32) ); } else { diff --git a/plugins/spudec/spu_decoder.c b/plugins/spudec/spu_decoder.c index 967c257229..8ec9c1956d 100644 --- a/plugins/spudec/spu_decoder.c +++ b/plugins/spudec/spu_decoder.c @@ -2,7 +2,7 @@ * spu_decoder.c : spu decoder thread ***************************************************************************** * Copyright (C) 2000-2001 VideoLAN - * $Id: spu_decoder.c,v 1.15 2002/04/18 12:51:59 sam Exp $ + * $Id: spu_decoder.c,v 1.16 2002/04/23 20:58:23 sam Exp $ * * Authors: Samuel Hocevar * @@ -426,13 +426,15 @@ static int ParseControlSequences( spudec_thread_t *p_spudec, case SPU_CMD_SET_PALETTE: /* 03xxxx (palette) */ - 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 ) { p_spu->p_sys->b_palette = 1; for( i = 0; i < 4 ; i++ ) { - pi_color = (u8*)p_spudec->p_config->p_demux_data - + 4 * GetBits( &p_spudec->bit_stream, 4 ); + pi_color = (void*)p_spudec->p_config->p_demux_data + + sizeof(int) + 4 * sizeof(u8) * + 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][2] = pi_color[1];