vlc | branch: master | Francois Cartegnie <[email protected]> | Sun Jun 7 19:55:21 2020 +0200| [036bde530b42c96c583447c6dccaceb3e623206e] | committer: Francois Cartegnie
demux: adaptive: make Content-Type no longer authoritative tired of bogus HLS configs ref #24817 > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=036bde530b42c96c583447c6dccaceb3e623206e --- modules/demux/adaptive/plumbing/Demuxer.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/modules/demux/adaptive/plumbing/Demuxer.cpp b/modules/demux/adaptive/plumbing/Demuxer.cpp index e8e123b3c9..43d3dafdc0 100644 --- a/modules/demux/adaptive/plumbing/Demuxer.cpp +++ b/modules/demux/adaptive/plumbing/Demuxer.cpp @@ -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)) _______________________________________________ vlc-commits mailing list [email protected] https://mailman.videolan.org/listinfo/vlc-commits
