From patchwork Sat Nov 18 10:26:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jay Zhang X-Patchwork-Id: 44711 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:6a89:b0:181:818d:5e7f with SMTP id bi9csp457797pzb; Sat, 18 Nov 2023 02:27:00 -0800 (PST) X-Google-Smtp-Source: AGHT+IH0bB3ZbvNieiF04vLCaaxCbUNqS2sXOl6mCNO04Srb9NgtBWnBgT/QoHvySlOLdJ8IOVBp X-Received: by 2002:a17:906:25a:b0:9d0:51d4:4d7f with SMTP id 26-20020a170906025a00b009d051d44d7fmr1442224ejl.1.1700303219707; Sat, 18 Nov 2023 02:26:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700303219; cv=none; d=google.com; s=arc-20160816; b=LitpRWQtSxhsQiKrGIBStslYRYGUVfq2IRRQnDW8eDLx0e7yWhRwW3zxQ5WBexP4oZ I5y8Cw9GWoUzz6FtCEcaEFke5WOF0P6pba6EF2P6qbctXL0JA6NFT/0mVomXkOyZn08f qiJqig7BdZqK2GvTuDwoju+Z3DW625GjHo7iwsphQSK5WkEhz1l3PQEZltfRa13c0EBG qApIdpeB2lUFxS9Nb2LnIoPpjHUsAxpByA0y1wE24SdqLRa82HSSBpBylDhfK5xKh1+8 3oSv7pg8zRZ1pw7R3LJ++37rYcrq5Pr+yL4YWGWa8A+r0clciO83xVn1vR6q+JsPXSDX 97gw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:message-id:date:to:from :dkim-signature:delivered-to; bh=mAb2+XqmtJfOjJNPnPkuEqLw0TLOoYrk7vfW8Q8TvsM=; fh=kL9YAkn9EoRgqEjEb6m2VwAhZz0J1XkeXyuc7m366iU=; b=zFGtOo5lbCRltafpTNOfejYRCairhV/zkI9jnwx9FHfs7az9GGDwTEl/DG3cXVzBgU iBZ0FWvZTkNNRIXe2+M9IktNMvXv7OQ40Lz/O/E17eC1apAM9HKsEdjLecOqzhJRtJVc CYBi8mM6LWbnpa5rSxhZiIDQqY6Z9x5ya5llvgVH6DIzT5f98N1IwFW4Dv3gTFCdgyNR xf/KUiynvdSziIwSOuXUwhQtQLF7yHEHbBbumQRzklHZxuE5TVvQt9GKaceSsVmeL1FO foD+3W54AC7Dkjg56o16KFyaEfgUsXbXq5HXFOUI8RGNZBCdajCeqwAsA8XnBnflG215 TxIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b=TcgGyt1P; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id cm4-20020a170906f58400b009e53dbbe3c8si983875ejd.607.2023.11.18.02.26.59; Sat, 18 Nov 2023 02:26:59 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b=TcgGyt1P; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 65CC068CD46; Sat, 18 Nov 2023 12:26:56 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-oi1-f176.google.com (mail-oi1-f176.google.com [209.85.167.176]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3141A68CCA0 for ; Sat, 18 Nov 2023 12:26:49 +0200 (EET) Received: by mail-oi1-f176.google.com with SMTP id 5614622812f47-3b3e13fc1f7so1878584b6e.0 for ; Sat, 18 Nov 2023 02:26:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700303207; x=1700908007; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=aOQxAzhTWmwE2RAbDGLjDsxZOlXX/sxrwzaI4tkyy9s=; b=TcgGyt1P0xJjN+5/1pXH4IfsvdCnaAQ5C4lrmMSrjGg5oiR+4xiGsu8EPBYn2L2ar1 L1L54CWtBymeXrfdeuHjKq0P2Vj93Mv+mXJmtpWKQCnSj17PcXQFJ9gHUocJy+xwLVMf Ifzv1i6XlRulyd9D7FWyfrMxNbCY3DPIhZlMayeJEi5leKkrNtv8rSgKnoZaml28vg3z QyZLcxIl71EjVkCXKU4ZwVh7MUow8v7rsJLmggNmPbGPwjnxui8uGGq8KnWzKgR+1gof BZkEiFLPcvDgvkptlR9EtBtWz75fVALre+kkGetmdWvGQDM37nvmD6ZnyVqFms+cto/j w4mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700303207; x=1700908007; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=aOQxAzhTWmwE2RAbDGLjDsxZOlXX/sxrwzaI4tkyy9s=; b=wiZcZxbDgYvfdNG9T+U1n0c/7+PxRvbr0OP7YAdNHSg0qcwAAmdUV248b9ekyghVH5 J/0tuKrhxvGz09VYPyERBWS7i1Xp/VHLJOaAwecDA8Aui+t2+InTNiOBUujrTwQWxV2P HmFKrGn5iqHHZY7zge5L6bNg9JpXuLnz/ek+O+YqLCoiqr8KNVpGh9JqZ3UBVxGjI42R VUKMg4gcH0nipgnomutzTMrkukJ8h5RGkjqAyGMrO0As0uJ+NKXwcbDI5+s5hMwQTzPN G4Ui/ZmaUYkv2OfmPV6GDI8xDn1Wetn5wnWHDJf5iYnd1lzr70+zr9U2YaBH//7VT2vd CC1w== X-Gm-Message-State: AOJu0YwxFaqQKpJY8iWjT8P1ukws/5Ly1qoEYQe7b793KyEI+68G6jOY BRdwHPxMdaoiukl5XWofX2g8QD1QLuxtxQ== X-Received: by 2002:a05:6808:278d:b0:3b2:ee75:31f with SMTP id es13-20020a056808278d00b003b2ee75031fmr2218287oib.49.1700303206948; Sat, 18 Nov 2023 02:26:46 -0800 (PST) Received: from J7700K. ([58.35.140.181]) by smtp.gmail.com with ESMTPSA id b15-20020a056a0002cf00b006c337ce0f26sm2832201pft.170.2023.11.18.02.26.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Nov 2023 02:26:46 -0800 (PST) From: Jay Zhang To: ffmpeg-devel@ffmpeg.org Date: Sat, 18 Nov 2023 18:26:35 +0800 Message-Id: <20231118102635.750620-1-wangyoucao577@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] avformat/movenc: fix safari cannot play generated hls due to empty sdtp atom 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 Cc: Jay Zhang Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: ColG83VFLKp6 This issue can be reproduced by command 'ffmpeg -i small_bunny_1080p_60fps.mp4 -an -c:v libx265 -tag:v hvc1 -f hls -hls_segment_type fmp4 out.m3u8'. After remove the empty sdtp atom, safari can play the out.m3u8 properly. Signed-off-by: Jay Zhang --- libavformat/movenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/movenc.c b/libavformat/movenc.c index e39f1ac987..34ac7e9dcc 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -2827,7 +2827,7 @@ static int mov_write_stbl_tag(AVFormatContext *s, AVIOContext *pb, MOVMuxContext track->par->codec_tag == MKTAG('r','t','p',' ')) && track->has_keyframes && track->has_keyframes < track->entry) mov_write_stss_tag(pb, track, MOV_SYNC_SAMPLE); - if (track->par->codec_type == AVMEDIA_TYPE_VIDEO && track->has_disposable) + if (track->par->codec_type == AVMEDIA_TYPE_VIDEO && track->has_disposable && track->entry) mov_write_sdtp_tag(pb, track); if (track->mode == MODE_MOV && track->flags & MOV_TRACK_STPS) mov_write_stss_tag(pb, track, MOV_PARTIAL_SYNC_SAMPLE);