Commit 036bde53 authored by François Cartegnie's avatar François Cartegnie 🤞

demux: adaptive: make Content-Type no longer authoritative

tired of bogus HLS configs
ref #24817
parent b3fe59fa
......@@ -114,18 +114,20 @@ bool MimeDemuxer::create()
return false;
StreamFormat format(StreamFormat::UNKNOWN);
char *type = stream_ContentType(p_newstream);
if(type)
{
format = StreamFormat(std::string(type));
free(type);
}
/* Try to probe */
const uint8_t *p_peek;
size_t i_peek = sourcestream->Peek(&p_peek, StreamFormat::PEEK_SIZE);
format = StreamFormat(reinterpret_cast<const void *>(p_peek), i_peek);
if(format == StreamFormat(StreamFormat::UNKNOWN))
{
const uint8_t *p_peek;
size_t i_peek = sourcestream->Peek(&p_peek, StreamFormat::PEEK_SIZE);
format = StreamFormat(reinterpret_cast<const void *>(p_peek), i_peek);
char *type = stream_ContentType(p_newstream);
if(type)
{
format = StreamFormat(std::string(type));
free(type);
}
}
if(format != StreamFormat(StreamFormat::UNKNOWN))
......
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