void LoadTags( );
void InformationCreate( );
void Seek( mtime_t i_date, mtime_t i_time_offset );
- int BlockGet( KaxBlock * & pp_block, int64_t *pi_ref1, int64_t *pi_ref2, int64_t *pi_duration );
+#if LIBMATROSKA_VERSION >= 0x000800
+ int BlockGet( KaxBlock * &, KaxSimpleBlock * &, int64_t *, int64_t *, int64_t *);
+#else
+ int BlockGet( KaxBlock * &, int64_t *, int64_t *, int64_t *);
+#endif
bool Select( mtime_t i_start_time );
void UnSelect( );
}
}
+#if LIBMATROSKA_VERSION >= 0x000800
+int matroska_segment_c::BlockGet( KaxBlock * & pp_block, KaxSimpleBlock * & pp_simpleblock, int64_t *pi_ref1, int64_t *pi_ref2, int64_t *pi_duration )
+#else
int matroska_segment_c::BlockGet( KaxBlock * & pp_block, int64_t *pi_ref1, int64_t *pi_ref2, int64_t *pi_duration )
+#endif
{
+#if LIBMATROSKA_VERSION >= 0x000800
+ pp_simpleblock = NULL;
+#endif
pp_block = NULL;
*pi_ref1 = 0;
*pi_ref2 = 0;
i_block_pos = el->GetElementPosition();
ep->Down();
}
+#if LIBMATROSKA_VERSION >= 0x000800
+ else if( MKV_IS_ID( el, KaxSimpleBlock ) )
+ {
+ pp_simpleblock = (KaxSimpleBlock*)el;
+
+ pp_simpleblock->ReadData( es.I_O() );
+ pp_simpleblock->SetParent( *cluster );
+
+ ep->Keep();
+ }
+#endif
break;
case 3:
if( MKV_IS_ID( el, KaxBlock ) )
{
*pi_ref1 = int64( ref ) * cluster->GlobalTimecodeScale();
}
- else
+ else if( *pi_ref2 == 0 )
{
*pi_ref2 = int64( ref ) * cluster->GlobalTimecodeScale();
}
int64_t i_block_ref1;
int64_t i_block_ref2;
+#if LIBMATROSKA_VERSION >= 0x000800
+ KaxSimpleBlock *simpleblock;
+
+ if( p_segment->BlockGet( block, simpleblock, &i_block_ref1, &i_block_ref2, &i_block_duration ) )
+#else
if( p_segment->BlockGet( block, &i_block_ref1, &i_block_ref2, &i_block_duration ) )
+#endif
{
if ( p_vsegment->Edition() && p_vsegment->Edition()->b_ordered )
{
{
i_return = 1;
delete block;
+#if LIBMATROSKA_VERSION >= 0x000800
+ delete simpleblock;
+#endif
break;
}
}
if ( !p_vsegment->SelectNext() )
{
delete block;
+#if LIBMATROSKA_VERSION >= 0x000800
+ delete simpleblock;
+#endif
break;
}
p_segment->UnSelect( );
{
msg_Err( p_demux, "Failed to select new segment" );
delete block;
+#if LIBMATROSKA_VERSION >= 0x000800
+ delete simpleblock;
+#endif
break;
}
delete block;
BlockDecode( p_demux, block, p_sys->i_pts, i_block_duration, i_block_ref1 >= 0 || i_block_ref2 > 0 );
delete block;
+#if LIBMATROSKA_VERSION >= 0x000800
+ delete simpleblock;
+#endif
i_block_count++;
// TODO optimize when there is need to leave or when seeking has been called
void matroska_segment_c::Seek( mtime_t i_date, mtime_t i_time_offset )
{
KaxBlock *block;
+#if LIBMATROSKA_VERSION >= 0x000800
+ KaxSimpleBlock *simpleblock;
+#endif
int i_track_skipping;
int64_t i_block_duration;
int64_t i_block_ref1;
while( i_track_skipping > 0 )
{
+#if LIBMATROSKA_VERSION >= 0x000800
+ if( BlockGet( block, simpleblock, &i_block_ref1, &i_block_ref2, &i_block_duration ) )
+#else
if( BlockGet( block, &i_block_ref1, &i_block_ref2, &i_block_duration ) )
+#endif
{
msg_Warn( &sys.demuxer, "cannot get block EOF?" );
}
delete block;
+#if LIBMATROSKA_VERSION >= 0x000800
+ delete simpleblock;
+#endif
}
}