Commit 01993028 authored by Gildas Bazin's avatar Gildas Bazin

* modules/access/dvdnav.c: call buttonUpdate() again when the video ES is started.

parent aadbe03c
...@@ -406,8 +406,8 @@ static int Control( demux_t *p_demux, int i_query, va_list args ) ...@@ -406,8 +406,8 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
case DEMUX_GET_TITLE_INFO: case DEMUX_GET_TITLE_INFO:
ppp_title = (input_title_t***)va_arg( args, input_title_t*** ); ppp_title = (input_title_t***)va_arg( args, input_title_t*** );
pi_int = (int*)va_arg( args, int* ); pi_int = (int*)va_arg( args, int* );
*((int*)va_arg( args, int* )) = 0; /* Title offset */ *((int*)va_arg( args, int* )) = 0; /* Title offset */
*((int*)va_arg( args, int* )) = 1; /* Chapter offset */ *((int*)va_arg( args, int* )) = 1; /* Chapter offset */
/* Duplicate title infos */ /* Duplicate title infos */
*pi_int = p_sys->i_title; *pi_int = p_sys->i_title;
...@@ -550,10 +550,31 @@ static int Demux( demux_t *p_demux ) ...@@ -550,10 +550,31 @@ static int Demux( demux_t *p_demux )
msleep( 40000 ); msleep( 40000 );
break; break;
} }
case DVDNAV_SPU_CLUT_CHANGE:
{
int i;
msg_Dbg( p_demux, "DVDNAV_SPU_CLUT_CHANGE" );
/* Update color lookup table (16 *uint32_t in packet) */
memcpy( p_sys->clut, packet, 16 * sizeof( uint32_t ) );
/* HACK to get the SPU tracks registered in the right order */
for( i = 0; i < 0x1f; i++ )
{
if( dvdnav_spu_stream_to_lang( p_sys->dvdnav, i ) != 0xffff )
ESNew( p_demux, 0xbd20 + i );
}
/* END HACK */
break;
}
case DVDNAV_SPU_STREAM_CHANGE: case DVDNAV_SPU_STREAM_CHANGE:
{ {
dvdnav_spu_stream_change_event_t *event = dvdnav_spu_stream_change_event_t *event =
(dvdnav_spu_stream_change_event_t*)packet; (dvdnav_spu_stream_change_event_t*)packet;
int i;
msg_Dbg( p_demux, "DVDNAV_SPU_STREAM_CHANGE" ); msg_Dbg( p_demux, "DVDNAV_SPU_STREAM_CHANGE" );
msg_Dbg( p_demux, " - physical_wide=%d", msg_Dbg( p_demux, " - physical_wide=%d",
event->physical_wide ); event->physical_wide );
...@@ -563,8 +584,17 @@ static int Demux( demux_t *p_demux ) ...@@ -563,8 +584,17 @@ static int Demux( demux_t *p_demux )
event->physical_pan_scan ); event->physical_pan_scan );
ESSubtitleUpdate( p_demux ); ESSubtitleUpdate( p_demux );
/* HACK to get the SPU tracks registered in the right order */
for( i = 0; i < 0x1f; i++ )
{
if( dvdnav_spu_stream_to_lang( p_sys->dvdnav, i ) != 0xffff )
ESNew( p_demux, 0xbd20 + i );
}
/* END HACK */
break; break;
} }
case DVDNAV_AUDIO_STREAM_CHANGE: case DVDNAV_AUDIO_STREAM_CHANGE:
{ {
dvdnav_audio_stream_change_event_t *event = dvdnav_audio_stream_change_event_t *event =
...@@ -574,6 +604,7 @@ static int Demux( demux_t *p_demux ) ...@@ -574,6 +604,7 @@ static int Demux( demux_t *p_demux )
/* TODO */ /* TODO */
break; break;
} }
case DVDNAV_VTS_CHANGE: case DVDNAV_VTS_CHANGE:
{ {
int32_t i_title = 0; int32_t i_title = 0;
...@@ -615,6 +646,7 @@ static int Demux( demux_t *p_demux ) ...@@ -615,6 +646,7 @@ static int Demux( demux_t *p_demux )
} }
break; break;
} }
case DVDNAV_CELL_CHANGE: case DVDNAV_CELL_CHANGE:
{ {
int32_t i_title = 0; int32_t i_title = 0;
...@@ -659,6 +691,7 @@ static int Demux( demux_t *p_demux ) ...@@ -659,6 +691,7 @@ static int Demux( demux_t *p_demux )
DemuxBlock( p_demux, packet, i_len ); DemuxBlock( p_demux, packet, i_len );
break; break;
} }
case DVDNAV_STOP: /* EOF */ case DVDNAV_STOP: /* EOF */
msg_Dbg( p_demux, "DVDNAV_STOP" ); msg_Dbg( p_demux, "DVDNAV_STOP" );
return 0; return 0;
...@@ -673,24 +706,6 @@ static int Demux( demux_t *p_demux ) ...@@ -673,24 +706,6 @@ static int Demux( demux_t *p_demux )
break; break;
} }
case DVDNAV_SPU_CLUT_CHANGE:
{
int i;
msg_Dbg( p_demux, "DVDNAV_SPU_CLUT_CHANGE" );
/* Update color lookup table (16 *uint32_t in packet) */
memcpy( p_sys->clut, packet, 16 * sizeof( uint32_t ) );
/* HACK to get the SPU tracks registered in the right order */
for( i = 0; i < 0x1f; i++ )
{
if( dvdnav_spu_stream_to_lang( p_sys->dvdnav, i ) != 0xffff )
ESNew( p_demux, 0xbd20 + i );
}
/* END HACK */
break;
}
case DVDNAV_HOP_CHANNEL: case DVDNAV_HOP_CHANNEL:
msg_Dbg( p_demux, "DVDNAV_HOP_CHANNEL" ); msg_Dbg( p_demux, "DVDNAV_HOP_CHANNEL" );
/* We should try to flush all our internal buffer */ /* We should try to flush all our internal buffer */
...@@ -851,19 +866,14 @@ static void ESSubtitleUpdate( demux_t *p_demux ) ...@@ -851,19 +866,14 @@ static void ESSubtitleUpdate( demux_t *p_demux )
ButtonUpdate( p_demux ); ButtonUpdate( p_demux );
dvdnav_current_title_info( p_sys->dvdnav, &i_title, &i_part ); dvdnav_current_title_info( p_sys->dvdnav, &i_title, &i_part );
if( i_title > 0 ) if( i_title > 0 ) return;
{
return;
}
if( i_spu >= 0 && i_spu <= 0x1f ) if( i_spu >= 0 && i_spu <= 0x1f )
{ {
ps_track_t *tk = &p_sys->tk[PS_ID_TO_TK(0xbd20 + i_spu)]; ps_track_t *tk = &p_sys->tk[PS_ID_TO_TK(0xbd20 + i_spu)];
if( !tk->b_seen ) ESNew( p_demux, 0xbd20 + i_spu );
{
ESNew( p_demux, 0xbd20 + i_spu);
}
/* be sure to unselect it (reset) */ /* be sure to unselect it (reset) */
es_out_Control( p_demux->out, ES_OUT_SET_ES_STATE, tk->es, es_out_Control( p_demux->out, ES_OUT_SET_ES_STATE, tk->es,
(vlc_bool_t)VLC_FALSE ); (vlc_bool_t)VLC_FALSE );
...@@ -981,10 +991,7 @@ static void ESNew( demux_t *p_demux, int i_id ) ...@@ -981,10 +991,7 @@ static void ESNew( demux_t *p_demux, int i_id )
ps_track_t *tk = &p_sys->tk[PS_ID_TO_TK(i_id)]; ps_track_t *tk = &p_sys->tk[PS_ID_TO_TK(i_id)];
vlc_bool_t b_select = VLC_FALSE; vlc_bool_t b_select = VLC_FALSE;
if( tk->b_seen ) if( tk->b_seen ) return;
{
return;
}
if( ps_track_fill( tk, i_id ) ) if( ps_track_fill( tk, i_id ) )
{ {
...@@ -1069,6 +1076,8 @@ static void ESNew( demux_t *p_demux, int i_id ) ...@@ -1069,6 +1076,8 @@ static void ESNew( demux_t *p_demux, int i_id )
es_out_Control( p_demux->out, ES_OUT_SET_ES, tk->es ); es_out_Control( p_demux->out, ES_OUT_SET_ES, tk->es );
} }
tk->b_seen = VLC_TRUE; tk->b_seen = VLC_TRUE;
if( tk->fmt.i_cat == VIDEO_ES ) ButtonUpdate( p_demux );
} }
/***************************************************************************** /*****************************************************************************
......
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