* access.c: access capabilities for dvdplay plugin.
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: access.c,v 1.10 2003/01/28 15:05:52 massiot Exp $
+ * $Id: access.c,v 1.11 2003/01/29 11:17:44 gbazin Exp $
*
* Author: Stéphane Borel <stef@via.ecp.fr>
*
/* Retrieve the highlight from dvdplay */
dvdplay_highlight( p_dvd->vmg, &p_dvd->hli );
- /* Fill our internal variables with this data */
- val.i_int = p_dvd->hli.i_x_start;
- var_Set( p_input, "x-start", val );
- val.i_int = p_dvd->hli.i_y_start;
- var_Set( p_input, "y-start", val );
- val.i_int = p_dvd->hli.i_x_end;
- var_Set( p_input, "x-end", val );
- val.i_int = p_dvd->hli.i_y_end;
- var_Set( p_input, "y-end", val );
-
- val.p_address = (void *)p_dvd->hli.pi_color;
- var_Set( p_input, "color", val );
- val.p_address = (void *)p_dvd->hli.pi_contrast;
- var_Set( p_input, "contrast", val );
-
- /* Tell the SPU decoder that there's a new highlight */
- val.b_bool = VLC_TRUE;
+ if( p_dvd->hli.i_x_start || p_dvd->hli.i_y_start ||
+ p_dvd->hli.i_x_end || p_dvd->hli.i_y_end )
+ {
+ /* Fill our internal variables with this data */
+ val.i_int = p_dvd->hli.i_x_start;
+ var_Set( p_input, "x-start", val );
+ val.i_int = p_dvd->hli.i_y_start;
+ var_Set( p_input, "y-start", val );
+ val.i_int = p_dvd->hli.i_x_end;
+ var_Set( p_input, "x-end", val );
+ val.i_int = p_dvd->hli.i_y_end;
+ var_Set( p_input, "y-end", val );
+
+ val.p_address = (void *)p_dvd->hli.pi_color;
+ var_Set( p_input, "color", val );
+ val.p_address = (void *)p_dvd->hli.pi_contrast;
+ var_Set( p_input, "contrast", val );
+
+ /* Tell the SPU decoder that there's a new highlight */
+ val.b_bool = VLC_TRUE;
+ }
+ else
+ {
+ /* Turn off the highlight */
+ val.b_bool = VLC_FALSE;
+ }
var_Set( p_input, "highlight", val );
vlc_mutex_unlock( p_mutex );
* es.c: functions to handle elementary streams.
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: es.c,v 1.4 2002/11/05 18:25:43 gbazin Exp $
+ * $Id: es.c,v 1.5 2003/01/29 11:17:44 gbazin Exp $
*
* Author: Stéphane Borel <stef@via.ecp.fr>
*
int i_subp = -1;
int i_id;
int i;
-
+
p_dvd = (dvd_data_t*)(p_input->p_access_data);
p_dvd->i_spu_nb = 0;
{
p_attr = dvdplay_subp_attr( p_dvd->vmg, i-1 );
++p_dvd->i_spu_nb;
-
+
if( pi_palette )
{
ADDES( i_id, VLC_FOURCC('s','p','u','b'), SPU_ES,
p_dvd = (dvd_data_t*)(p_input->p_access_data);
+ /* For audio: check user settings first, then check dvdplay settings. */
+ i_audio = config_GetInt( p_input, "audio-channel" );
+ if( i_audio <= 0 || i_audio > p_dvd->i_audio_nb )
+ {
+ /* if i_audio = -1 dvdplay_audio_info() will select a default channel,
+ * otherwise it warns libdvdplay that we have chosen another stream. */
+ i_audio = -1;
+ }
dvdplay_audio_info( p_dvd->vmg, &i_audio_nr, &i_audio );
+
+ /* For spu: check user settings first, the check dvdplay settings. */
+ i_subp = config_GetInt( p_input, "spu-channel" );
+ if( i_subp <= 0 || i_subp > p_dvd->i_spu_nb )
+ {
+ i_subp = -1;
+ }
dvdplay_subp_info( p_dvd->vmg, &i_subp_nr, &i_subp );
input_SelectES( p_input, p_input->stream.pp_es[0] );
-// if( !i_audio ) i_audio = 1;
if( i_audio > p_dvd->i_audio_nb ) i_audio = 1;
if( ( i_audio > 0 ) && ( p_dvd->i_audio_nb > 0 ) )
{
if( config_GetInt( p_input, "audio-type" ) == REQUESTED_A52 )
{
int i_a52 = i_audio;
-
+
while( ( i_a52 < p_dvd->i_audio_nb ) &&
( p_input->stream.pp_es[i_a52]->i_fourcc !=
VLC_FOURCC('a','5','2','b') ) )
{
input_SelectES( p_input,
p_input->stream.pp_es[i_a52] );
-
+
/* warn libdvdplay that we have chosen another stream */
dvdplay_audio_info( p_dvd->vmg, &i_audio_nr, &i_a52 );
}
else
{
-// input_SelectES( p_input,
-// p_input->stream.pp_es[i_audio] );
+ /* none found, select the default one */
+ input_SelectES( p_input,
+ p_input->stream.pp_es[i_audio] );
}
}
else
}
}
+ if( i_subp > p_dvd->i_spu_nb ) i_subp = -1;
if( ( i_subp > 0 ) && ( p_dvd->i_spu_nb > 0 ) )
{
i_subp += p_dvd->i_audio_nb;