Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: "Martin Storsjö" <martin@martin.st>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Cc: Zhao Zhili <zhilizhao@tencent.com>
Subject: Re: [FFmpeg-devel] [PATCH] avformat/movenc: Fix editlist with hybrid_fragmented
Date: Fri, 13 Jun 2025 10:32:02 +0300 (EEST)
Message-ID: <ec2ed897-2952-3973-b173-111d2aeaf69e@martin.st> (raw)
In-Reply-To: <tencent_4C46930F885333EC536295CCA9186EA04505@qq.com>

On Fri, 13 Jun 2025, Zhao Zhili wrote:

> From: Zhao Zhili <zhilizhao@tencent.com>
>
> The segment_duration must not be set to zero when writing the moov
> atom for the second time. This is related to edit lists in standard
> MP4 files.
> ---
> libavformat/movenc.c | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/libavformat/movenc.c b/libavformat/movenc.c
> index cd5b45f6fe..a651d6d618 100644
> --- a/libavformat/movenc.c
> +++ b/libavformat/movenc.c
> @@ -4036,8 +4036,13 @@ static int mov_write_edts_tag(AVIOContext *pb, MOVMuxContext *mov,
>     /* For fragmented files, we don't know the full length yet. Setting
>      * duration to 0 allows us to only specify the offset, including
>      * the rest of the content (from all future fragments) without specifying
> -     * an explicit duration. */
> -    if (mov->flags & FF_MOV_FLAG_FRAGMENT)
> +     * an explicit duration.
> +     *
> +     * For hybrid_fragmented during mov_write_trailer (mov->moov_written != 0),
> +     * don't reset duration to zero.
> +     */
> +    if (mov->flags & FF_MOV_FLAG_FRAGMENT &&
> +        !(mov->flags & FF_MOV_FLAG_HYBRID_FRAGMENTED && mov->moov_written))
>         duration = 0;
>
>     /* duration */
> -- 
> 2.46.0

LGTM, this sounds reasonable to me.

// Martin

_______________________________________________
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".

      reply	other threads:[~2025-06-13  7:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-12 17:32 Zhao Zhili
2025-06-13  7:32 ` Martin Storsjö [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ec2ed897-2952-3973-b173-111d2aeaf69e@martin.st \
    --to=martin@martin.st \
    --cc=ffmpeg-devel@ffmpeg.org \
    --cc=zhilizhao@tencent.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git