msg_Warn( p_demux, "cannot set PGC positioning flag" );
}
- /* Set menu language ("en")
- * XXX: maybe it would be better to set it like audio/spu
- * or to create a --menu-language option */
- if( dvdnav_menu_language_select( p_sys->dvdnav, (char*)LANGUAGE_DEFAULT ) !=
+ /* Set menu language
+ * XXX A menu-language may be better than sub-language */
+ psz_code = DemuxGetLanguageCode( p_demux, "sub-language" );
+ if( dvdnav_menu_language_select( p_sys->dvdnav, psz_code ) !=
DVDNAV_STATUS_OK )
{
msg_Warn( p_demux, "can't set menu language to '%s' (%s)",
- LANGUAGE_DEFAULT, dvdnav_err_to_string( p_sys->dvdnav ) );
+ psz_code, dvdnav_err_to_string( p_sys->dvdnav ) );
+ /* We try to fall back to 'en' */
+ if( strcmp( psz_code, LANGUAGE_DEFAULT ) )
+ dvdnav_menu_language_select( p_sys->dvdnav, (char*)LANGUAGE_DEFAULT );
}
+ free( psz_code );
/* Set audio language */
psz_code = DemuxGetLanguageCode( p_demux, "audio-language" );
switch( i_event )
{
case DVDNAV_BLOCK_OK: /* mpeg block */
+ p_sys->p_ev->b_still = false;
DemuxBlock( p_demux, packet, i_len );
break;
case DVDNAV_STILL_FRAME:
{
- /* We send a dummy mpeg2 end of sequence to force still frame display */
- static const uint8_t buffer[] = {
- 0x00, 0x00, 0x01, 0xe0, 0x00, 0x07,
- 0x80, 0x00, 0x00,
- 0x00, 0x00, 0x01, 0xB7,
- };
- DemuxBlock( p_demux, buffer, sizeof(buffer) );
-
- /* */
dvdnav_still_event_t *event = (dvdnav_still_event_t*)packet;
vlc_mutex_lock( &p_sys->p_ev->lock );
if( !p_sys->p_ev->b_still )
{
+ /* We send a dummy mpeg2 end of sequence to force still frame display */
+ static const uint8_t buffer[] = {
+ 0x00, 0x00, 0x01, 0xe0, 0x00, 0x07,
+ 0x80, 0x00, 0x00,
+ 0x00, 0x00, 0x01, 0xB7,
+ };
+ DemuxBlock( p_demux, buffer, sizeof(buffer) );
+
msg_Dbg( p_demux, "DVDNAV_STILL_FRAME" );
msg_Dbg( p_demux, " - length=0x%x", event->length );
p_sys->p_ev->b_still = true;
char *p;
psz_lang = var_CreateGetString( p_demux, psz_var );
+ if( !psz_lang )
+ return strdup(LANGUAGE_DEFAULT);
+
/* XXX: we will use only the first value
* (and ignore other ones in case of a list) */
- if( ( p = strchr( psz_lang, ',' ) ) ) *p = '\0';
+ if( ( p = strchr( psz_lang, ',' ) ) )
+ *p = '\0';
for( pl = p_languages; pl->psz_iso639_1 != NULL; pl++ )
{
+ if( *psz_lang == '\0' )
+ continue;
if( !strcasecmp( pl->psz_eng_name, psz_lang ) ||
!strcasecmp( pl->psz_native_name, psz_lang ) ||
!strcasecmp( pl->psz_iso639_1, psz_lang ) ||