示例#1
0
文件: Segment.cpp 项目: 0xheart0/vlc
SegmentChunk* ISegment::toChunk(size_t index, BaseRepresentation *ctxrep, HTTPConnectionManager *connManager)
{
    SegmentChunk *chunk;
    try
    {
        chunk = getChunk(getUrlSegment().toString(index, ctxrep), connManager);
        if (!chunk)
            return NULL;
    }
    catch (int)
    {
        return NULL;
    };

    chunk->setRepresentation(ctxrep);

    return chunk;
}
示例#2
0
SegmentChunk* ISegment::toChunk(size_t index, BaseRepresentation *ctxrep)
{
    SegmentChunk *chunk;
    try
    {
        chunk = getChunk(getUrlSegment().toString(index, ctxrep));
        if (!chunk)
            return NULL;
    }
    catch (int)
    {
        return NULL;
    }

    if(startByte != endByte)
    {
        chunk->setStartByte(startByte);
        chunk->setEndByte(endByte);
    }

    chunk->setRepresentation(ctxrep);

    return chunk;
}