diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2023-05-15 00:56:10 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2023-05-15 03:02:28 +0200 |
commit | 954d16fa3f09a04c7917a1c69a5c3e283554cb1d (patch) | |
tree | 6a9fd10a32acaa3bb97d34f73365282024682263 /libavformat | |
parent | a7b06bfc5d20b12ff0122702c09517cf359fbb66 (diff) | |
download | ffmpeg-954d16fa3f09a04c7917a1c69a5c3e283554cb1d.tar.gz |
avformat/hls: Try to implement RFC8216 playlist refusal
This should fix the regression since 6b1f68ccb04d791f0250e05687c346a99ff47ea1
Should fix Ticket10353 (please test and report cases that still fail)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/hls.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/libavformat/hls.c b/libavformat/hls.c index 11e345b280..425df3b26b 100644 --- a/libavformat/hls.c +++ b/libavformat/hls.c @@ -2534,7 +2534,16 @@ static int hls_probe(const AVProbeData *p) strstr(p->buf, "#EXT-X-TARGETDURATION:") || strstr(p->buf, "#EXT-X-MEDIA-SEQUENCE:")) { - if (!av_match_ext(p->filename, "m3u8,hls,m3u")) { + int mime_ok = p->mime_type && !( + av_strcasecmp(p->mime_type, "application/vnd.apple.mpegurl") && + av_strcasecmp(p->mime_type, "audio/mpegurl") && + av_strcasecmp(p->mime_type, "audio/x-mpegurl") && + 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) { av_log(NULL, AV_LOG_ERROR, "Not detecting m3u8/hls with non standard extension\n"); return 0; } |