fixed more bugs and warnings in cues handling

Change-Id: Ifef1a18b5c7b7ad2bee84909d2cc698f32feba8e
This commit is contained in:
matthewjheaney 2010-09-23 12:02:55 -04:00
parent 0ca566d081
commit 5942555352
2 changed files with 9 additions and 8 deletions

View File

@ -1201,11 +1201,12 @@ void Segment::AppendCluster(Cluster* pCluster)
const long long ns = m_pInfo->GetDuration(); const long long ns = m_pInfo->GetDuration();
if (ns <= 0) if (ns <= 0)
2048; n = 2048;
else
const long long nn = (ns + 999999999LL) / 1000000000LL; {
const long long sec = (ns + 999999999LL) / 1000000000LL;
n = static_cast<size_t>(nn); n = static_cast<size_t>(sec);
}
} }
Cluster** const qq = new Cluster*[n]; 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; return m_pInfo;
} }
@ -3493,7 +3494,7 @@ Cluster::GetEntry(
LoadBlockEntries(); LoadBlockEntries();
assert(m_pEntries); //TODO: handle empty cluster assert(m_pEntries); //TODO: handle empty cluster
assert(m_entriesCount > 0); 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<size_t>(tp.m_block); const size_t block = static_cast<size_t>(tp.m_block);
const size_t index = block - 1; const size_t index = block - 1;

View File

@ -473,7 +473,7 @@ public:
bool AddCluster(Cluster*, long long); bool AddCluster(Cluster*, long long);
Tracks* GetTracks() const; Tracks* GetTracks() const;
const SegmentInfo* const GetInfo() const; const SegmentInfo* GetInfo() const;
long long GetDuration() const; long long GetDuration() const;
//NOTE: this turned out to be too inefficient. //NOTE: this turned out to be too inefficient.