/*****************************************************************************
* mkv.cpp : matroska demuxer
*****************************************************************************
- * Copyright (C) 2003-2004 the VideoLAN team
+ * Copyright (C) 2003-2005, 2008, 2010 the VideoLAN team
* $Id$
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
N_("Dummy Elements"),
N_("Read and discard unknown EBML elements (not good for broken files)."), true );
- add_shortcut( "mka" )
- add_shortcut( "mkv" )
+ add_shortcut( "mka", "mkv" )
vlc_module_end ()
class demux_sys_t;
goto error;
}
- if (var_InheritInteger( p_demux, "mkv-preload-local-dir" ))
+ if (var_InheritBool( p_demux, "mkv-preload-local-dir" ))
{
/* get the files from the same dir from the same family (based on p_demux->psz_path) */
- if (p_demux->psz_path[0] != '\0' && !strcmp(p_demux->psz_access, ""))
+ if (p_demux->psz_file && !strcmp(p_demux->psz_access, ""))
{
// assume it's a regular file
// get the directory path
- s_path = p_demux->psz_path;
+ s_path = p_demux->psz_file;
if (s_path.at(s_path.length() - 1) == DIR_SEP_CHAR)
{
s_path = s_path.substr(0,s_path.length()-1);
s_filename = s_path + DIR_SEP_CHAR + psz_file;
#ifdef WIN32
- if (!strcasecmp(s_filename.c_str(), p_demux->psz_path))
+ if (!strcasecmp(s_filename.c_str(), p_demux->psz_file))
#else
- if (!s_filename.compare(p_demux->psz_path))
+ if (!s_filename.compare(p_demux->psz_file))
#endif
{
free (psz_file);
}
/* seek without index or without date */
- if( f_percent >= 0 && (var_InheritInteger( p_demux, "mkv-seek-percent" ) || !p_segment->b_cues || i_date < 0 ))
+ if( f_percent >= 0 && (var_InheritBool( p_demux, "mkv-seek-percent" ) || !p_segment->b_cues || i_date < 0 ))
{
if( p_sys->f_duration >= 0 && p_segment->b_cues )
{
p_block->i_pts = VLC_TS_INVALID;
p_block->i_dts = i_pts;
}
+ else if( tk->b_pts_only )
+ {
+ p_block->i_pts = i_pts;
+ p_block->i_dts = i_pts;
+ }
else
{
p_block->i_pts = i_pts;
p_block->i_dts = p_block->i_pts;
else
p_block->i_dts = min( i_pts, tk->i_last_dts + (mtime_t)(tk->i_default_duration >> 10));
- p_sys->i_pts = p_block->i_dts;
}
}
tk->i_last_dts = p_block->i_dts;