avformat/hls: Check mime_ok first

This should be a few nano seconds faster (not measureable)
But Collectively the whole humankind watching hls will safe a minute

Found-by: Leo Izen

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2023-05-15 21:28:26 +02:00
parent 19a74bc794
commit a0cb5722fd
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64

View File

@ -2541,9 +2541,9 @@ static int hls_probe(const AVProbeData *p)
av_strcasecmp(p->mime_type, "application/x-mpegurl")
);
if (!av_match_ext (p->filename, "m3u8,hls,m3u") &&
ff_match_url_ext(p->filename, "m3u8,hls,m3u") <= 0 &&
!mime_ok) {
if (!mime_ok &&
!av_match_ext (p->filename, "m3u8,hls,m3u") &&
ff_match_url_ext(p->filename, "m3u8,hls,m3u") <= 0) {
av_log(NULL, AV_LOG_ERROR, "Not detecting m3u8/hls with non standard extension\n");
return 0;
}