}
// preload all the linked segments for all preloaded segments
-void demux_sys_t::PreloadLinked()
+bool demux_sys_t::PreloadLinked()
{
size_t i, j;
virtual_segment_c *p_seg;
p_current_segment = VirtualFromSegments( &opened_segments );
+ if ( !p_current_segment )
+ return false;
used_segments.push_back( p_current_segment );
}
// TODO decide which segment should be first used (VMG for DVD)
+
+ return true;
}
virtual_segment_c *demux_sys_t::VirtualFromSegments( std::vector<matroska_segment_c*> *p_segments ) const
{
+ if ( p_segments->empty() )
+ return NULL;
virtual_segment_c *p_result = new virtual_segment_c( p_segments );
return p_result;
}
virtual_chapter_c *FindChapter( int64_t i_find_uid, virtual_segment_c * & p_segment_found );
void PreloadFamily( const matroska_segment_c & of_segment );
- void PreloadLinked();
+ bool PreloadLinked();
bool PreparePlayback( virtual_segment_c *p_new_segment );
matroska_stream_c *AnalyseAllSegmentsFound( demux_t *p_demux, EbmlStream *p_estream, bool b_initial = false );
void JumpTo( virtual_segment_c & p_segment, virtual_chapter_c * p_chapter );
p_sys->PreloadFamily( *p_segment );
}
- p_sys->PreloadLinked();
-
- if ( !p_sys->PreparePlayback( NULL ) )
+ if ( !p_sys->PreloadLinked() ||
+ !p_sys->PreparePlayback( NULL ) )
{
msg_Err( p_demux, "cannot use the segment" );
goto error;