Commit da676267 authored by Steve Lhomme's avatar Steve Lhomme Committed by Jean-Baptiste Kempf

demux:mkv: initialize all the mkv_track_t fields in the constructor

No object should be left with uninitialized members.
Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent f3ba8c95
......@@ -207,24 +207,6 @@ void matroska_segment_c::ParseTrackEntry( const KaxTrackEntry *m )
/* Init the track */
mkv_track_t track;
track.b_default = true;
track.b_enabled = true;
track.b_forced = false;
track.i_number = 0;
track.i_extra_data = 0;
track.p_extra_data = NULL;
track.codec = "";
track.b_dts_only = false;
track.b_pts_only = false;
track.b_no_duration = false;
track.i_default_duration = 0;
track.f_timecodescale = 1.0;
track.i_last_dts = 0;
track.i_skip_until_fpos = -1;
EbmlUInteger *pTrackType = static_cast<EbmlUInteger*>(m->FindElt(EBML_INFO(KaxTrackType)));
uint8 ttype;
if (likely(pTrackType != NULL))
......@@ -253,33 +235,6 @@ void matroska_segment_c::ParseTrackEntry( const KaxTrackEntry *m )
break;
}
track.fmt.psz_language = strdup("English");
track.fmt.psz_description = NULL;
track.f_fps = 0;
track.p_es = NULL;
track.i_original_rate = 0;
track.i_chans_to_reorder = 0;
std::memset( &track.pi_chan_table, 0, sizeof( track.pi_chan_table ) );
track.p_sys = NULL;
track.b_inited = false;
track.b_discontinuity = false;
track.i_data_init = 0;
track.p_data_init = NULL;
track.str_codec_name = "";
track.i_compression_type = MATROSKA_COMPRESSION_NONE;
track.i_encoding_scope = MATROSKA_ENCODING_SCOPE_ALL_FRAMES;
track.p_compression_data = NULL;
track.i_seek_preroll = 0;
track.i_codec_delay = 0;
MkvTree( sys.demuxer, 2, "Track Entry" );
struct MetaDataCapture {
......
......@@ -183,6 +183,40 @@ public:
class mkv_track_t
{
public:
mkv_track_t() :
b_default(true)
,b_enabled(true)
,b_forced(false)
,i_number(0)
,i_extra_data(0)
,p_extra_data(NULL)
,b_dts_only(false)
,b_pts_only(false)
,b_no_duration(false)
,i_default_duration(0)
,f_timecodescale(1.0)
,i_last_dts(0)
,i_skip_until_fpos(-1)
,f_fps(0)
,p_es(NULL)
,i_original_rate(0)
,i_chans_to_reorder(0)
,p_sys(NULL)
,b_inited(false)
,b_discontinuity(false)
,i_data_init(0)
,p_data_init(NULL)
,i_compression_type(MATROSKA_COMPRESSION_NONE)
,i_encoding_scope(MATROSKA_ENCODING_SCOPE_ALL_FRAMES)
,p_compression_data(NULL)
,i_seek_preroll(0)
,i_codec_delay(0)
{
std::memset( &fmt, 0, sizeof( fmt ) );
std::memset( &pi_chan_table, 0, sizeof( pi_chan_table ) );
fmt.psz_language = strdup("English");
}
typedef unsigned int track_id_t;
bool b_default;
......
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