Commit aa54a0f2 authored by Francois Cartegnie's avatar Francois Cartegnie

demux: dash: only look for index on segment start

parent d84d7803
...@@ -107,8 +107,11 @@ block_t * AbstractChunk::read(size_t sizehint, mtime_t *time) ...@@ -107,8 +107,11 @@ block_t * AbstractChunk::read(size_t sizehint, mtime_t *time)
if(block) if(block)
{ {
if(getBytesRead() == 0)
block->i_flags |= BLOCK_FLAG_HEADER;
setBytesRead(getBytesRead() + block->i_buffer); setBytesRead(getBytesRead() + block->i_buffer);
onDownload(&block); onDownload(&block);
block->i_flags ^= BLOCK_FLAG_HEADER;
} }
return block; return block;
......
...@@ -43,7 +43,7 @@ DashIndexSegment::DashIndexSegment(ICanonicalUrl *parent) : ...@@ -43,7 +43,7 @@ DashIndexSegment::DashIndexSegment(ICanonicalUrl *parent) :
void DashIndexSegment::onChunkDownload(block_t **pp_block, SegmentChunk *, BaseRepresentation *rep) void DashIndexSegment::onChunkDownload(block_t **pp_block, SegmentChunk *, BaseRepresentation *rep)
{ {
if(!rep) if(!rep || ((*pp_block)->i_flags & BLOCK_FLAG_HEADER) == 0 )
return; return;
IndexReader br(rep->getPlaylist()->getVLCObject()); IndexReader br(rep->getPlaylist()->getVLCObject());
......
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