Commit 7e8a0f41 authored by Steve Lhomme's avatar Steve Lhomme

mkv.cpp: store silent tracks info

parent 7ecdbca3
...@@ -290,6 +290,7 @@ typedef struct ...@@ -290,6 +290,7 @@ typedef struct
/* hack : it's for seek */ /* hack : it's for seek */
vlc_bool_t b_search_keyframe; vlc_bool_t b_search_keyframe;
vlc_bool_t b_silent;
/* informative */ /* informative */
char *psz_codec_name; char *psz_codec_name;
...@@ -1216,6 +1217,12 @@ int matroska_segment_t::BlockGet( KaxBlock **pp_block, int64_t *pi_ref1, int64_t ...@@ -1216,6 +1217,12 @@ int matroska_segment_t::BlockGet( KaxBlock **pp_block, int64_t *pi_ref1, int64_t
IndexAppendCluster( cluster ); IndexAppendCluster( cluster );
} }
// reset silent tracks
for (size_t i=0; i<tracks.size(); i++)
{
tracks[i]->b_silent = VLC_FALSE;
}
ep->Down(); ep->Down();
} }
else if( MKV_IS_ID( el, KaxCues ) ) else if( MKV_IS_ID( el, KaxCues ) )
...@@ -1237,6 +1244,10 @@ int matroska_segment_t::BlockGet( KaxBlock **pp_block, int64_t *pi_ref1, int64_t ...@@ -1237,6 +1244,10 @@ int matroska_segment_t::BlockGet( KaxBlock **pp_block, int64_t *pi_ref1, int64_t
ctc.ReadData( es.I_O(), SCOPE_ALL_DATA ); ctc.ReadData( es.I_O(), SCOPE_ALL_DATA );
cluster->InitTimecode( uint64( ctc ), i_timescale ); cluster->InitTimecode( uint64( ctc ), i_timescale );
} }
else if( MKV_IS_ID( el, KaxClusterSilentTracks ) )
{
ep->Down();
}
else if( MKV_IS_ID( el, KaxBlockGroup ) ) else if( MKV_IS_ID( el, KaxBlockGroup ) )
{ {
ep->Down(); ep->Down();
...@@ -1274,6 +1285,20 @@ int matroska_segment_t::BlockGet( KaxBlock **pp_block, int64_t *pi_ref1, int64_t ...@@ -1274,6 +1285,20 @@ int matroska_segment_t::BlockGet( KaxBlock **pp_block, int64_t *pi_ref1, int64_t
*pi_ref2 = int64( ref ); *pi_ref2 = int64( ref );
} }
} }
else if( MKV_IS_ID( el, KaxClusterSilentTrackNumber ) )
{
KaxClusterSilentTrackNumber &track_num = *(KaxClusterSilentTrackNumber*)el;
track_num.ReadData( es.I_O() );
// find the track
for (size_t i=0; i<tracks.size(); i++)
{
if ( tracks[i]->i_number == uint32(track_num))
{
tracks[i]->b_silent = VLC_TRUE;
break;
}
}
}
} }
else else
{ {
...@@ -2310,6 +2335,7 @@ void matroska_segment_t::ParseTrackEntry( EbmlMaster *m ) ...@@ -2310,6 +2335,7 @@ void matroska_segment_t::ParseTrackEntry( EbmlMaster *m )
tk->b_default = VLC_TRUE; tk->b_default = VLC_TRUE;
tk->b_enabled = VLC_TRUE; tk->b_enabled = VLC_TRUE;
tk->b_silent = VLC_FALSE;
tk->i_number = tracks.size() - 1; tk->i_number = tracks.size() - 1;
tk->i_extra_data = 0; tk->i_extra_data = 0;
tk->p_extra_data = NULL; tk->p_extra_data = 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