From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id AED6145EA0 for ; Mon, 15 May 2023 03:14:23 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E997D68C026; Mon, 15 May 2023 06:14:20 +0300 (EEST) Received: from mail-yb1-f181.google.com (mail-yb1-f181.google.com [209.85.219.181]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C5C1168BEE3 for ; Mon, 15 May 2023 06:14:14 +0300 (EEST) Received: by mail-yb1-f181.google.com with SMTP id 3f1490d57ef6-ba6fc11831dso730008276.1 for ; Sun, 14 May 2023 20:14:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684120453; x=1686712453; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=KqkWpbJGmjIUZ91GHtoeXgSMWW3nkze5dGNe/HFHWaA=; b=rWE51fW1/5p5OlDSEXc8UCIAx2AclFZxHc2Yf0mk8raymbPqhXWuS4bhabAVOqZky7 +5rYKM8m9IGbksJR4D92GFD5B+q/ICfWVs1japheJS/J73pqq//q2lLd+VsVUgYHK21E R0yS0MiYNt+20QoRh1ofhnPaV4IMYDWB7G/QrV5dVNlTouR1Pg3eEVIVrap6GNexWIuZ b+ba23v2g3WZsi8HZ/SzsZ/hRdy3sqNYyYSOHDeFZ45DU0cv0x+h5CSMicro8OG9qBDx 1TjnVHxeN2j5KlOt6VlrZJPvZjaWvKJ1hdfAqJ8ZfpdzPjy9UMbyc7AP5J155g5kG9pP BoCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684120453; x=1686712453; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=KqkWpbJGmjIUZ91GHtoeXgSMWW3nkze5dGNe/HFHWaA=; b=RT0XaPG4MR9W840vKkAHr3Hj9m69EgUoC1fFqrywkPR58imuMfm6kZioi4ZoNyBCaC cpqwlTTl4aJCrOpqFJetfJsYRutolMmk2susCrM2xR2kOhDG0EUy0m2lR7Zk8SLKgPpZ Aw8ShcO8BtcidS7k7RDIEiq6WgnU12Kz7KWQ7mh3UnW4Ld0PTN4RxJ1AB+7wV8dWGM9h HFuESq9hdevM2hYLXNuQXjvnfO6vpJ6KcpmQDC82VWf8pfUL+0gqUyDtlvREGNyVe1p3 mF1HK1BQP6FTIhNJF/yEIwZhMgT8vBdeNS8CFj4Rn+Fhp82Vjf9C6I+iLHcKcoeLHSWA hqiQ== X-Gm-Message-State: AC+VfDyX6i98V9wekn4u5xyuOMxyCFRsVcZ8WbcautY5cUi2/xLLvA9j /MTIU0cC1+Lx1TLKCzmfk9iD+osTEu4= X-Google-Smtp-Source: ACHHUZ4sKvSwkFKNI/tEb+nVSg5hFaXch+J2q+BTiBaZMGlEuWLsxDqVUJOPLFm16ER67AM3bfsSVg== X-Received: by 2002:a81:1786:0:b0:55a:6115:98f5 with SMTP id 128-20020a811786000000b0055a611598f5mr28523085ywx.1.1684120453414; Sun, 14 May 2023 20:14:13 -0700 (PDT) Received: from [192.168.1.35] (c-98-224-219-15.hsd1.mi.comcast.net. [98.224.219.15]) by smtp.gmail.com with ESMTPSA id n1-20020a0dcb01000000b0055a503ca1e8sm7408561ywd.109.2023.05.14.20.14.12 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 14 May 2023 20:14:13 -0700 (PDT) Message-ID: Date: Sun, 14 May 2023 23:14:12 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Content-Language: en-US-large To: ffmpeg-devel@ffmpeg.org References: <20230515000547.1703-1-michael@niedermayer.cc> <20230515000547.1703-3-michael@niedermayer.cc> From: Leo Izen In-Reply-To: <20230515000547.1703-3-michael@niedermayer.cc> Subject: Re: [FFmpeg-devel] [PATCH 3/3] avformat/hls: Try to implement RFC8216 playlist refusal X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On 5/14/23 20:05, Michael Niedermayer wrote: > This is not well tested and can likely be improved, just a > hotfix for hls probe failures since 6b1f68ccb04d791f0250e05687c346a99ff47ea1 > > Should fix Ticket10353 (please test and report cases that still fail) > > Signed-off-by: Michael Niedermayer > --- > libavformat/hls.c | 11 ++++++++++- > 1 file changed, 10 insertions(+), 1 deletion(-) > > diff --git a/libavformat/hls.c b/libavformat/hls.c > index df2442c376..790ae7a96a 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 && What's the point of checking both av_match_ext and ff_match_url_ext here? Should only want one or the other. > + !mime_ok) { Put !mime_ok first to take advantage of lazy &&, as it will usually be okay in practice. > av_log(NULL, AV_LOG_ERROR, "Not detecting m3u8/hls with non standard extension\n"); > return 0; > } _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".