Skip to content
Snippets Groups Projects
Commit 84620c0d authored by François Cartegnie's avatar François Cartegnie :fingers_crossed:
Browse files

demux: adaptive: fix probing with multiple ID3

regression regarding #24237 after chunk probe only change

(cherry picked from commit 4e87c549)
parent de58fc83
No related branches found
No related tags found
2 merge requests!3533Backport MR 3236 to 3.0.x,!1123[3.0.x] backport/upgrade adaptive code
......@@ -118,10 +118,10 @@ StreamFormat::StreamFormat(const void *data_, size_t sz)
else /* Check Packet Audio formats */
{
/* It MUST have ID3 header, but HLS spec is an oxymoron */
if(sz > 10 && ID3TAG_IsTag(data, false))
while(sz > 10 && ID3TAG_IsTag(data, false))
{
size_t tagsize = ID3TAG_Parse(data, sz, ID3Callback, this);
if(tagsize >= sz)
if(tagsize >= sz || tagsize == 0)
return; /* not enough peek */
data += tagsize;
sz -= tagsize;
......
......@@ -97,18 +97,17 @@ int HLSStream::ID3TAG_Parse_Handler(uint32_t i_tag, const uint8_t *p_payload, si
block_t * HLSStream::checkBlock(block_t *p_block, bool b_first)
{
if(b_first && p_block &&
p_block->i_buffer >= 10 && ID3TAG_IsTag(p_block->p_buffer, false))
if(b_first && p_block)
{
while( p_block->i_buffer )
while(p_block->i_buffer >= 10 && ID3TAG_IsTag(p_block->p_buffer, false))
{
size_t i_size = ID3TAG_Parse( p_block->p_buffer, p_block->i_buffer,
ID3TAG_Parse_Handler, static_cast<void *>(this) );
if(i_size >= p_block->i_buffer || i_size == 0)
break;
/* Skip ID3 for demuxer */
p_block->p_buffer += i_size;
p_block->i_buffer -= i_size;
if( i_size == 0 )
break;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment