Skip to content
Snippets Groups Projects
Commit 39c471fa authored by François Cartegnie's avatar François Cartegnie :fingers_crossed:
Browse files

demux: adaptive: remove mishandled sequence offset

mishandled in lookups. should be enforced in parsing.
refs VLCKit/-/issues/382
parent ce1a28b0
No related branches found
No related tags found
No related merge requests found
......@@ -39,9 +39,6 @@
using namespace adaptive::http;
using namespace adaptive::playlist;
const int ISegment::SEQUENCE_INVALID = 0;
const int ISegment::SEQUENCE_FIRST = 1;
ISegment::ISegment(const ICanonicalUrl *parent):
ICanonicalUrl( parent ),
startByte (0),
......@@ -51,7 +48,7 @@ ISegment::ISegment(const ICanonicalUrl *parent):
classId = CLASSID_ISEGMENT;
startTime.Set(0);
duration.Set(0);
sequence = SEQUENCE_INVALID;
sequence = 0;
templated = false;
discontinuity = false;
}
......@@ -122,7 +119,7 @@ void ISegment::setByteRange(size_t start, size_t end)
void ISegment::setSequenceNumber(uint64_t seq)
{
sequence = SEQUENCE_FIRST + seq;
sequence = seq;
}
uint64_t ISegment::getSequenceNumber() const
......
......@@ -94,8 +94,6 @@ namespace adaptive
int classId;
bool templated;
uint64_t sequence;
static const int SEQUENCE_INVALID;
static const int SEQUENCE_FIRST;
};
class Segment : public ISegment
......
......@@ -44,7 +44,7 @@ bool HLSSegment::prepareChunk(SharedResources *res, SegmentChunk *chunk, BaseRep
{
if (encryption.iv.size() != 16)
{
uint64_t sequence = getSequenceNumber() - Segment::SEQUENCE_FIRST;
uint64_t sequence = getSequenceNumber();
encryption.iv.clear();
encryption.iv.resize(16);
encryption.iv[15] = (sequence >> 0) & 0xff;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment