Commit 6607097f authored by Rocky Bernstein's avatar Rocky Bernstein

Menu selection of subtitles for CVD and OGT handled properly.

system.c: enters the correct subtitle numbers into spu-es.  OGT now
has the correct number of subtitles (with each having the correct
number).

ogt.c: Allow for dynamic switching/selection of subtitles. 
parent 3f465da7
......@@ -244,7 +244,7 @@ Reassemble( decoder_t *p_dec, block_t **pp_block )
p_buffer[1], p_buffer[2], p_buffer[3], p_buffer[4],
p_block->i_buffer);
#if 1
#if 0
if( config_GetInt( p_dec, "spu-channel" ) != p_buffer[1] )
return NULL;
#else
......@@ -259,8 +259,15 @@ Reassemble( decoder_t *p_dec, block_t **pp_block )
if( var_Get( p_input, "spu-channel", &val ) ) return NULL;
if( val.i_int == -1 || val.i_int != p_buffer[1] )
dbg_print( (DECODE_DBG_PACKET),
"val.i_int %x p_buffer[i] %x", val.i_int, p_buffer[1]);
/* The dummy ES that the menu selection uses has an 0x70 at
the head which we need to strip off. */
if( val.i_int == -1 || (val.i_int & 0x03) != p_buffer[1] ) {
dbg_print( DECODE_DBG_PACKET, "subtitle not for us.\n");
return NULL;
}
}
#endif
......
......@@ -2,7 +2,7 @@
* system.c: helper module for TS, PS and PES management
*****************************************************************************
* Copyright (C) 1998-2004 VideoLAN
* $Id: system.c,v 1.31 2004/02/20 17:16:50 massiot Exp $
* $Id$
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Michel Lespinasse <walken@via.ecp.fr>
......@@ -566,7 +566,14 @@ static uint16_t GetID( input_thread_t *p_input, data_packet_t * p_data )
/* FIXME : this is not valid if the header is split in multiple
* packets */
/* stream_private_id */
i_id |= p_data->p_demux_start[ 9 + p_data->p_demux_start[8] ] << 8;
if ( p_data->p_demux_start[ 9 + p_data->p_demux_start[8] ] == 0x70 ) {
/* SVCD/OGT ES: 0x70 = private stream. We pick out the subtitle
number this way though. */
i_id = 0x7000 | p_data->p_demux_start[10 + p_data->p_demux_start[8]];
} else {
i_id |= p_data->p_demux_start[ 9 + p_data->p_demux_start[8] ] << 8;
}
/* FIXME: See note about cur_scr_time above. */
p_mpeg_demux->cur_scr_time = -1;
......@@ -883,6 +890,7 @@ static es_descriptor_t * ParsePS( input_thread_t * p_input,
if( p_es == NULL && !p_demux->b_has_PSM )
{
int i_fourcc, i_cat;
char *psz_desc = NULL;
/* Set stream type and auto-spawn. */
if( (i_id & 0xF0) == 0xE0 )
......@@ -970,20 +978,32 @@ static es_descriptor_t * ParsePS( input_thread_t * p_input,
i_fourcc = VLC_FOURCC('l','p','c','b');
i_cat = AUDIO_ES;
}
else if( (i_id & 0xFFFF) == 0x70BD )
else if( (i_id & 0xFF00) == 0x7000 )
{
/* SVCD OGT subtitles in stream 0x070 */
i_fourcc = VLC_FOURCC('o','g','t', ' ');
i_cat = SPU_ES;
b_auto_spawn = VLC_TRUE;
psz_desc = malloc( strlen( _("SVCD Subtitle %i") ) + 2 );
if( psz_desc )
sprintf( psz_desc, _("SVCD Subtitle %i"),
i_id & 0x03 );
}
else if( ((i_id >> 8) & 0xFF) <= 0x03 &&
#define CVD_SUBTITLE_NUM(id) ((i_id >> 8) & 0xFF)
else if( CVD_SUBTITLE_NUM(i_id) <= 0x03 &&
(i_id & 0x00FF) == 0x00BD )
{
/* CVD subtitles (0x00->0x03) */
i_fourcc = VLC_FOURCC('c','v','d', ' ');
i_cat = SPU_ES;
b_auto_spawn = VLC_TRUE;
psz_desc = malloc( strlen( _("CVD Subtitle %i") ) + 2 );
if( psz_desc )
sprintf( psz_desc, _("CVD Subtitle %i"),
CVD_SUBTITLE_NUM(i_id) );
}
else
{
......@@ -992,7 +1012,7 @@ static es_descriptor_t * ParsePS( input_thread_t * p_input,
}
p_es = input_AddES( p_input, p_input->stream.pp_programs[0],
i_id, i_cat, NULL, 0 );
i_id, i_cat, psz_desc, 0 );
p_es->i_stream_id = p_data->p_demux_start[3];
p_es->i_fourcc = i_fourcc;
......
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