Skip to content

Commit

Permalink
feat(HlsParser): support EXT-X-BYTERANGE tag
Browse files Browse the repository at this point in the history
Signed-off-by: pingkai <pingkai010@gmail.com>
  • Loading branch information
pingkai committed Feb 28, 2020
1 parent e7fce23 commit a232ae7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion framework/demuxer/play_list/HlsParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ namespace Cicada {
}

prevbyterangeoffset = range.first + range.second;
// segment->setByteRange(range.first, prevbyterangeoffset - 1);
pSegment->setByteRange(range.first, prevbyterangeoffset - 1);
ctx_byterange = nullptr;
}

Expand Down
6 changes: 6 additions & 0 deletions framework/demuxer/play_list/segment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,10 @@ namespace Cicada {
{
encryption = enc;
}

void segment::setByteRange(int64_t start, int64_t end)
{
rangeStart = start;
rangeEnd = end;
}
}
4 changes: 4 additions & 0 deletions framework/demuxer/play_list/segment.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ namespace Cicada{

void setEncryption(SegmentEncryption enc);

void setByteRange(int64_t start, int64_t end);

public:
std::string mUri = "";
uint64_t startTime = 0;
Expand All @@ -38,6 +40,8 @@ namespace Cicada{
static const int SEQUENCE_INVALID;
static const int SEQUENCE_FIRST;
SegmentEncryption encryption;
int64_t rangeStart {INT64_MIN};
int64_t rangeEnd {INT64_MIN};

std::shared_ptr<segment> init_section{nullptr};

Expand Down

0 comments on commit a232ae7

Please sign in to comment.