Commit cbbc8d8d authored by Steve Lhomme's avatar Steve Lhomme

demux:mkv: make all EbmlParser respect the mkv-use-dummy setting

LoadTags() had a hard value for no reason. If the user wants a strict check
then we must respect that choice.
parent a62d3f30
......@@ -29,15 +29,14 @@
/*****************************************************************************
* Ebml Stream parser
*****************************************************************************/
EbmlParser::EbmlParser( EbmlStream *es, EbmlElement *el_start, demux_t *p_demux,
bool b_with_dummy ) :
EbmlParser::EbmlParser( EbmlStream *es, EbmlElement *el_start, demux_t *p_demux ) :
p_demux( p_demux ),
m_es( es ),
mi_level( 1 ),
m_got( NULL ),
mi_user_level( 1 ),
mb_keep( false ),
mb_dummy( b_with_dummy )
mb_dummy( var_InheritBool( p_demux, "mkv-use-dummy" ) )
{
memset( m_el, 0, sizeof( *m_el ) * M_EL_MAXSIZE);
m_el[0] = el_start;
......@@ -63,18 +62,10 @@ EbmlParser::~EbmlParser( void )
}
void EbmlParser::reconstruct( EbmlStream* es, EbmlElement* el_start, demux_t* p_demux )
{
this->reconstruct( es, el_start, p_demux, var_InheritBool( p_demux, "mkv-use-dummy" ) );
}
void EbmlParser::reconstruct( EbmlStream* es, EbmlElement* el_start, demux_t* p_demux,
bool b_with_dummy)
{
this->~EbmlParser();
new( static_cast<void*>( this ) ) EbmlParser(
es, el_start, p_demux, b_with_dummy
);
new( static_cast<void*>( this ) ) EbmlParser( es, el_start, p_demux );
}
void EbmlParser::Up( void )
......
......@@ -33,12 +33,10 @@
class EbmlParser
{
public:
EbmlParser( EbmlStream *es, EbmlElement *el_start, demux_t *p_demux,
bool b_with_dummy );
EbmlParser( EbmlStream *es, EbmlElement *el_start, demux_t *p_demux );
~EbmlParser( void );
void reconstruct( EbmlStream*, EbmlElement*, demux_t*);
void reconstruct( EbmlStream*, EbmlElement*, demux_t*, bool b_with_dummy );
void Up( void );
void Down( void );
......
......@@ -58,7 +58,7 @@ matroska_segment_c::matroska_segment_c( demux_sys_t & demuxer, EbmlStream & estr
,psz_date_utc(NULL)
,i_default_edition(0)
,sys(demuxer)
,ep( EbmlParser(&estream, p_seg, &demuxer.demuxer, var_InheritBool( &demuxer.demuxer, "mkv-use-dummy" ) ))
,ep( EbmlParser(&estream, p_seg, &demuxer.demuxer ))
,b_preloaded(false)
,b_ref_external_segments(false)
{
......@@ -100,7 +100,7 @@ void matroska_segment_c::LoadCues( KaxCues *cues )
return;
}
EbmlParser eparser (&es, cues, &sys.demuxer, var_InheritBool( &sys.demuxer, "mkv-use-dummy" ) );
EbmlParser eparser (&es, cues, &sys.demuxer );
while( ( el = eparser.Get() ) != NULL )
{
if( MKV_IS_ID( el, KaxCuePoint ) )
......@@ -493,7 +493,7 @@ bool matroska_segment_c::PreloadClusters(uint64 i_cluster_pos)
while (payload.stop_parsing == false)
{
EbmlParser parser ( &es, segment, &sys.demuxer, var_InheritBool( &sys.demuxer, "mkv-use-dummy" ) );
EbmlParser parser ( &es, segment, &sys.demuxer );
EbmlElement* el = parser.Get();
if( el == NULL )
......@@ -1006,8 +1006,7 @@ void matroska_segment_c::EnsureDuration()
es.I_O().setFilePointer( i_last_cluster_pos, seek_beginning );
EbmlParser eparser ( &es, segment, &sys.demuxer, var_InheritBool(
&sys.demuxer, "mkv-use-dummy" ) );
EbmlParser eparser ( &es, segment, &sys.demuxer );
// locate the definitely last cluster in the stream
......
......@@ -92,8 +92,7 @@ void matroska_segment_c::ParseSeekHead( KaxSeekHead *seekhead )
if( !sys.b_seekable )
return;
EbmlParser eparser ( &es, seekhead, &sys.demuxer,
var_InheritBool( &sys.demuxer, "mkv-use-dummy" ) );
EbmlParser eparser ( &es, seekhead, &sys.demuxer );
while( ( l = eparser.Get() ) != NULL )
{
......
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