[vlc-commits] demux: dash: only look for index on segment start
Francois Cartegnie
git at videolan.org
Fri Oct 30 21:19:40 CET 2015
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri Oct 30 17:45:37 2015 +0100| [aa54a0f21b87d17c256790a2199aa0d9931f29c7] | committer: Francois Cartegnie
demux: dash: only look for index on segment start
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=aa54a0f21b87d17c256790a2199aa0d9931f29c7
---
modules/demux/adaptative/http/Chunk.cpp | 3 +++
modules/demux/dash/mpd/DASHSegment.cpp | 2 +-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/modules/demux/adaptative/http/Chunk.cpp b/modules/demux/adaptative/http/Chunk.cpp
index 5940f95..14e263a 100644
--- a/modules/demux/adaptative/http/Chunk.cpp
+++ b/modules/demux/adaptative/http/Chunk.cpp
@@ -107,8 +107,11 @@ block_t * AbstractChunk::read(size_t sizehint, mtime_t *time)
if(block)
{
+ if(getBytesRead() == 0)
+ block->i_flags |= BLOCK_FLAG_HEADER;
setBytesRead(getBytesRead() + block->i_buffer);
onDownload(&block);
+ block->i_flags ^= BLOCK_FLAG_HEADER;
}
return block;
diff --git a/modules/demux/dash/mpd/DASHSegment.cpp b/modules/demux/dash/mpd/DASHSegment.cpp
index f4f2b9f..f96428c 100644
--- a/modules/demux/dash/mpd/DASHSegment.cpp
+++ b/modules/demux/dash/mpd/DASHSegment.cpp
@@ -43,7 +43,7 @@ DashIndexSegment::DashIndexSegment(ICanonicalUrl *parent) :
void DashIndexSegment::onChunkDownload(block_t **pp_block, SegmentChunk *, BaseRepresentation *rep)
{
- if(!rep)
+ if(!rep || ((*pp_block)->i_flags & BLOCK_FLAG_HEADER) == 0 )
return;
IndexReader br(rep->getPlaylist()->getVLCObject());
More information about the vlc-commits
mailing list