From 5942555352bf5f8fb8ac4229a1e5ce56ef48929c Mon Sep 17 00:00:00 2001 From: matthewjheaney Date: Thu, 23 Sep 2010 12:02:55 -0400 Subject: [PATCH] fixed more bugs and warnings in cues handling Change-Id: Ifef1a18b5c7b7ad2bee84909d2cc698f32feba8e --- mkvparser.cpp | 15 ++++++++------- mkvparser.hpp | 2 +- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/mkvparser.cpp b/mkvparser.cpp index d406c57..9eb6308 100644 --- a/mkvparser.cpp +++ b/mkvparser.cpp @@ -1201,11 +1201,12 @@ void Segment::AppendCluster(Cluster* pCluster) const long long ns = m_pInfo->GetDuration(); if (ns <= 0) - 2048; - - const long long nn = (ns + 999999999LL) / 1000000000LL; - - n = static_cast(nn); + n = 2048; + else + { + const long long sec = (ns + 999999999LL) / 1000000000LL; + n = static_cast(sec); + } } Cluster** const qq = new Cluster*[n]; @@ -2279,7 +2280,7 @@ Tracks* Segment::GetTracks() const } -const SegmentInfo* const Segment::GetInfo() const +const SegmentInfo* Segment::GetInfo() const { return m_pInfo; } @@ -3493,7 +3494,7 @@ Cluster::GetEntry( LoadBlockEntries(); assert(m_pEntries); //TODO: handle empty cluster assert(m_entriesCount > 0); - assert(tp.m_block <= m_entriesCount); //blocks are 1-based + assert(tp.m_block <= (long long)m_entriesCount); //blocks are 1-based const size_t block = static_cast(tp.m_block); const size_t index = block - 1; diff --git a/mkvparser.hpp b/mkvparser.hpp index 091661d..39ac55b 100644 --- a/mkvparser.hpp +++ b/mkvparser.hpp @@ -473,7 +473,7 @@ public: bool AddCluster(Cluster*, long long); Tracks* GetTracks() const; - const SegmentInfo* const GetInfo() const; + const SegmentInfo* GetInfo() const; long long GetDuration() const; //NOTE: this turned out to be too inefficient.