#endif
#include <assert.h>
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <errno.h>
+
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_input.h>
#include <vlc_fs.h>
#include <vlc_url.h>
#include <vlc_vout.h>
-
#include <vlc_dialog.h>
-
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-#include <sys/types.h>
-#ifdef HAVE_SYS_STAT_H
-# include <sys/stat.h>
-#endif
-#ifdef HAVE_FCNTL_H
-# include <fcntl.h>
-#endif
-#include <errno.h>
-
#include <vlc_keys.h>
#include <vlc_iso_lang.h>
#define ANGLE_LONGTEXT N_( \
"Default DVD angle." )
-#define CACHING_TEXT N_("Caching value in ms")
-#define CACHING_LONGTEXT N_( \
- "Caching value for DVDs. This "\
- "value should be set in milliseconds." )
#define MENU_TEXT N_("Start directly in menu")
#define MENU_LONGTEXT N_( \
"Start the DVD directly in the main menu. This "\
set_subcategory( SUBCAT_INPUT_ACCESS )
add_integer( "dvdnav-angle", 1, ANGLE_TEXT,
ANGLE_LONGTEXT, false )
- add_integer( "dvdnav-caching", DEFAULT_PTS_DELAY / 1000,
- CACHING_TEXT, CACHING_LONGTEXT, true )
add_bool( "dvdnav-menu", true,
MENU_TEXT, MENU_LONGTEXT, false )
set_capability( "access_demux", 5 )
vlc_module_end ()
/* Shall we use libdvdnav's read ahead cache? */
+#ifdef __OS2__
+#define DVD_READ_CACHE 0
+#else
#define DVD_READ_CACHE 1
+#endif
/*****************************************************************************
* Local prototypes
i_angle = var_CreateGetInteger( p_demux, "dvdnav-angle" );
if( i_angle <= 0 ) i_angle = 1;
- /* Update default_pts to a suitable value for dvdnav access */
- var_Create( p_demux, "dvdnav-caching", VLC_VAR_INTEGER|VLC_VAR_DOINHERIT );
-
/* FIXME hack hack hack hack FIXME */
/* Get p_input and create variable */
p_sys->p_input = demux_GetParentInput( p_demux );
return VLC_SUCCESS;
case DEMUX_GET_PTS_DELAY:
- *va_arg( args, int64_t * )
- = (int64_t)var_GetInteger( p_demux, "dvdnav-caching" ) *1000;
+ *va_arg( args, int64_t * ) =
+ INT64_C(1000) * var_InheritInteger( p_demux, "disc-caching" );
return VLC_SUCCESS;
case DEMUX_GET_META:
if( dvdnav_current_title_info( p_sys->dvdnav, &i_title,
&i_part ) == DVDNAV_STATUS_OK )
{
- if( i_title >= 0 && i_title < p_sys->i_title &&
- i_part >= 1 && i_part <= p_sys->title[i_title]->i_seekpoint &&
- p_demux->info.i_seekpoint != i_part - 1 )
+ if( i_title >= 0 && i_title < p_sys->i_title )
{
- p_demux->info.i_update |= INPUT_UPDATE_SEEKPOINT;
- p_demux->info.i_seekpoint = i_part - 1;
+ p_demux->info.i_update |= INPUT_UPDATE_TITLE;
+ p_demux->info.i_title = i_title;
+
+ if( i_part >= 1 && i_part <= p_sys->title[i_title]->i_seekpoint &&
+ p_demux->info.i_seekpoint != i_part - 1 )
+ {
+ p_demux->info.i_update |= INPUT_UPDATE_SEEKPOINT;
+ p_demux->info.i_seekpoint = i_part - 1;
+ }
}
}
break;
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 ) ||
!strcasecmp( pl->psz_iso639_2T, psz_lang ) ||
!strcasecmp( pl->psz_iso639_2B, psz_lang ) )
{
int32_t i_chapters;
uint64_t i_title_length;
+ uint64_t *p_chapters_time;
#if defined(HAVE_DVDNAV_DESCRIBE_TITLE_CHAPTERS)
- uint64_t *p_chapters_time;
i_chapters = dvdnav_describe_title_chapters( p_sys->dvdnav, i,
&p_chapters_time,
&i_title_length );
- if( i_chapters > 0 )
- free( p_chapters_time );
- else
+ if( i_chapters < 1 )
+ {
i_title_length = 0;
+ p_chapters_time = NULL;
+ }
#else
if( dvdnav_get_number_of_parts( p_sys->dvdnav, i, &i_chapters ) != DVDNAV_STATUS_OK )
i_chapters = 0;
i_title_length = 0;
+ p_chapters_time = NULL;
#endif
t = vlc_input_title_New();
t->i_length = i_title_length * 1000 / 90;
for( int j = 0; j < __MAX( i_chapters, 1 ); j++ )
{
s = vlc_seekpoint_New();
+ if( p_chapters_time )
+ s->i_time_offset = p_chapters_time[j] * 1000 / 90;
TAB_APPEND( t->i_seekpoint, t->seekpoint, s );
}
-
+ free( p_chapters_time );
TAB_APPEND( p_sys->i_title, p_sys->title, t );
}
}
#endif
int ret = VLC_EGENERIC;
-
-#ifdef HAVE_SYS_STAT_H
struct stat stat_info;
if( fstat( fd, &stat_info ) == -1 )
goto bailout;
-
if( !S_ISREG( stat_info.st_mode ) )
{
if( S_ISDIR( stat_info.st_mode ) || S_ISBLK( stat_info.st_mode ) )
ret = VLC_SUCCESS; /* Let dvdnav_open() do the probing */
goto bailout;
}
-#endif
+
/* Match extension as the anchor exhibits too many false positives */
const char *ext = strrchr( psz_name, '.' );
if( ext == NULL )
goto bailout;
ext++;
- if( strcasecmp( ext, "iso" ) && strcasecmp( ext, "img" ) )
+ if( strcasecmp( ext, "iso" ) && strcasecmp( ext, "img" ) &&
+ strcasecmp( ext, "mdf" ) && strcasecmp( ext, "dvd" ) &&
+ strcasecmp( ext, "bin" ) && strcasecmp( ext, "nrg" ) )
goto bailout;
/* Try to find the anchor (2 bytes at LBA 256) */