Commit 34986c22 authored by Zhao Zhili's avatar Zhao Zhili Committed by François Cartegnie

demux: adaptive: fix segment compare

Signed-off-by: François Cartegnie's avatarFrancois Cartegnie <fcvlcdev@free.fr>
(cherry picked from commit ed414dc3)
parent 764bf9e5
......@@ -143,18 +143,21 @@ int ISegment::compare(ISegment *other) const
{
if(duration.Get())
{
stime_t diff = startTime.Get() - other->startTime.Get();
if(diff)
return diff / diff;
if(startTime.Get() > other->startTime.Get())
return 1;
else if(startTime.Get() < other->startTime.Get())
return -1;
}
size_t diff = startByte - other->startByte;
if(diff)
return diff / diff;
if(startByte > other->startByte)
return 1;
else if(startByte < other->startByte)
return -1;
diff = endByte - other->endByte;
if(diff)
return diff / diff;
if(endByte > other->endByte)
return 1;
else if(endByte < other->endByte)
return -1;
return 0;
}
......
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