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 071E546384 for ; Mon, 15 May 2023 19:30:49 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D2B0B68BE1B; Mon, 15 May 2023 22:30:46 +0300 (EEST) Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3195D68A92B for ; Mon, 15 May 2023 22:30:40 +0300 (EEST) Received: (Authenticated sender: michael@niedermayer.cc) by mail.gandi.net (Postfix) with ESMTPSA id 27070C0005 for ; Mon, 15 May 2023 19:30:38 +0000 (UTC) Date: Mon, 15 May 2023 21:30:36 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20230515193036.GQ1391451@pb2> References: <20230515000547.1703-1-michael@niedermayer.cc> <20230515000547.1703-3-michael@niedermayer.cc> MIME-Version: 1.0 In-Reply-To: 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-Type: multipart/mixed; boundary="===============6363840985272058380==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============6363840985272058380== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="2ogddTzD/QdCyZmF" Content-Disposition: inline --2ogddTzD/QdCyZmF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, May 14, 2023 at 11:14:12PM -0400, Leo Izen wrote: >=20 >=20 > 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 6b1f68ccb04d791f0250e05687c346a99ff= 47ea1 > >=20 > > Should fix Ticket10353 (please test and report cases that still fail) > >=20 > > Signed-off-by: Michael Niedermayer > > --- > > libavformat/hls.c | 11 ++++++++++- > > 1 file changed, 10 insertions(+), 1 deletion(-) > >=20 > > 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 =3D 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") <=3D 0 && > What's the point of checking both av_match_ext and ff_match_url_ext here? > Should only want one or the other. is p->filename a URL ? > > + !mime_ok) { >=20 > Put !mime_ok first to take advantage of lazy &&, as it will usually be ok= ay > in practice. ok, will reorder it thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Homeopathy is like voting while filling the ballot out with transparent ink. Sometimes the outcome one wanted occurs. Rarely its worse than filling out a ballot properly. --2ogddTzD/QdCyZmF Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEIAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCZGKIWAAKCRBhHseHBAsP q4HGAJ9qKEQhQndlgTVKOEvmakGlz+RTIwCfUJHLvppQCPDohNjKIqLW4+S84/s= =uqFV -----END PGP SIGNATURE----- --2ogddTzD/QdCyZmF-- --===============6363840985272058380== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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". --===============6363840985272058380==--