add_bool( "dvdnav-menu", true, NULL,
MENU_TEXT, MENU_LONGTEXT, false )
set_capability( "access_demux", 5 )
- add_shortcut( "dvd" )
- add_shortcut( "dvdnav" )
- add_shortcut( "file" )
+ add_shortcut( "dvd", "dvdnav", "file" )
set_callbacks( Open, Close )
vlc_module_end ()
uint8_t palette[4][4];
bool b_spu_change;
+ /* Aspect ration */
+ struct {
+ unsigned i_num;
+ unsigned i_den;
+ } sar;
+
/* */
int i_title;
input_title_t **title;
char *psz_name;
char *psz_code;
- if( !p_demux->psz_path || !*p_demux->psz_path )
+ if( !p_demux->psz_file || !*p_demux->psz_file )
{
/* Only when selected */
if( !p_demux->psz_access || !*p_demux->psz_access )
}
}
else
- psz_name = ToLocaleDup( p_demux->psz_path );
+ psz_name = ToLocaleDup( p_demux->psz_file );
#ifdef WIN32
/* Remove trailing backslash, otherwise dvdnav_open will fail */
*(psz_name + strlen(psz_name) - 1) = '\0';
}
#endif
- decode_URI( psz_name );
/* Try some simple probing to avoid going through dvdnav_open too often */
if( ProbeDVD( p_demux, psz_name ) != VLC_SUCCESS )
p_sys->b_reset_pcr = false;
ps_track_init( p_sys->tk );
+ p_sys->sar.i_num = 0;
+ p_sys->sar.i_den = 0;
p_sys->i_mux_rate = 0;
p_sys->i_pgc_length = 0;
p_sys->b_spu_change = false;
tk->b_seen = false;
}
+#if defined(HAVE_DVDNAV_GET_VIDEO_RESOLUTION)
+ uint32_t i_width, i_height;
+ if( dvdnav_get_video_resolution( p_sys->dvdnav,
+ &i_width, &i_height ) )
+ i_width = i_height = 0;
+ switch( dvdnav_get_video_aspect( p_sys->dvdnav ) )
+ {
+ case 0:
+ p_sys->sar.i_num = 4 * i_height;
+ p_sys->sar.i_den = 3 * i_width;
+ break;
+ case 3:
+ p_sys->sar.i_num = 16 * i_height;
+ p_sys->sar.i_den = 9 * i_width;
+ break;
+ default:
+ p_sys->sar.i_num = 0;
+ p_sys->sar.i_den = 0;
+ break;
+ }
+#endif
+
if( dvdnav_current_title_info( p_sys->dvdnav, &i_title,
&i_part ) == DVDNAV_STATUS_OK )
{
/* Add a new ES */
if( tk->fmt.i_cat == VIDEO_ES )
{
+ tk->fmt.video.i_sar_num = p_sys->sar.i_num;
+ tk->fmt.video.i_sar_den = p_sys->sar.i_den;
b_select = true;
}
else if( tk->fmt.i_cat == AUDIO_ES )