[FFmpeg-cvslog] avformat/hls: Better message from hls_probe()

Michael Niedermayer git at videolan.org
Mon May 22 04:01:14 EEST 2023


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Mon May 15 21:33:03 2023 +0200| [5b630743c625669b7c6ee4a01d4e0e8b51d7e636] | committer: Michael Niedermayer

avformat/hls: Better message from hls_probe()

Found-by: Kacper Michajlow <kasper93 at gmail.com>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5b630743c625669b7c6ee4a01d4e0e8b51d7e636
---

 libavformat/hls.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/libavformat/hls.c b/libavformat/hls.c
index fc29ef0ca9..2bc142510e 100644
--- a/libavformat/hls.c
+++ b/libavformat/hls.c
@@ -2536,17 +2536,23 @@ static int hls_probe(const AVProbeData *p)
 
         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/mpegurl")
+            );
+
+        int mime_x = p->mime_type && !(
             av_strcasecmp(p->mime_type, "audio/x-mpegurl") &&
             av_strcasecmp(p->mime_type, "application/x-mpegurl")
             );
 
         if (!mime_ok &&
+            !mime_x &&
             !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");
+            av_log(NULL, AV_LOG_ERROR, "Not detecting m3u8/hls with non standard extension and non standard mime type\n");
             return 0;
         }
+        if (mime_x)
+            av_log(NULL, AV_LOG_WARNING, "mime type is not rfc8216 compliant\n");
 
         return AVPROBE_SCORE_MAX;
     }



More information about the ffmpeg-cvslog mailing list