sout: hls: keep track of output header blocks

Those will be used as a delimitation hint from muxers. WebVTT, TS and
mp4frag will use those eventually.
This commit is contained in:
Alaric Senat 2024-02-02 12:10:10 +01:00 committed by Steve Lhomme
parent 0335dee979
commit 86755ae74d
1 changed files with 4 additions and 0 deletions

View File

@ -47,6 +47,7 @@ typedef struct
block_t *begin;
block_t **end;
vlc_tick_t length;
block_t *last_header;
} hls_block_chain_t;
static inline void hls_block_chain_Reset(hls_block_chain_t *chain)
@ -54,6 +55,7 @@ static inline void hls_block_chain_Reset(hls_block_chain_t *chain)
chain->begin = NULL;
chain->end = &chain->begin;
chain->length = 0;
chain->last_header = NULL;
}
/**
@ -549,6 +551,8 @@ static ssize_t AccessOutWrite(sout_access_out_t *access, block_t *block)
{
block_ChainLastAppend(&it->muxed_output.end, block);
it->muxed_output.length += length;
if (block->i_flags & BLOCK_FLAG_HEADER)
it->muxed_output.last_header = block;
}
/* Check if muxed outputs have enough data to output a segment. */