From: David Lemler <david@lemler.family> To: ffmpeg-devel@ffmpeg.org Subject: [FFmpeg-devel] [PATCH] lavc/libvpxenc: prevent fifo from filling up Date: Fri, 7 Jul 2023 16:31:03 -0500 Message-ID: <1338627269.18082.1688765464391@localhost> (raw) In-Reply-To: <CABWgkXLCuiS9FLQZRZsBEdW3cp9Md5KLF7qNUcDuz242SJtcJQ@mail.gmail.com> Prevent the fifo used in encoding VPx videos from filling up and stopping encode when it reaches 21845 items, which happens when the video has more than that number of frames. Incorporated suggestion from James Zern to prevent calling frame_data_submit() at all when performing the first pass of a 2-pass encode so the fifo is not filled at all; replaces original patch which drained the fifo after filling to prevent it from becoming full. Fixes the regression originally introduced in 5bda4ec6c3cb6f286bb40dee4457c3c26e0f78cb Co-authored-by: James Zern <jzern@google.com> Signed-off-by: David Lemler <david@lemler.family> --- libavcodec/libvpxenc.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c index 8833df2d68..549ac55aaa 100644 --- a/libavcodec/libvpxenc.c +++ b/libavcodec/libvpxenc.c @@ -1780,9 +1780,11 @@ static int vpx_encode(AVCodecContext *avctx, AVPacket *pkt, } } - res = frame_data_submit(avctx, ctx->fifo, frame); - if (res < 0) - return res; + if (!(avctx->flags & AV_CODEC_FLAG_PASS1)) { + res = frame_data_submit(avctx, ctx->fifo, frame); + if (res < 0) + return res; + } } // this is for encoding with preset temporal layering patterns defined in -- 2.41.0.windows.1 _______________________________________________ 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".
next prev parent reply other threads:[~2023-07-07 21:31 UTC|newest] Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-07-04 5:08 David Lemler [not found] ` <CABWgkX+D5b_7WJPDkv74tZVP_xWjSt8ym-T9FT-Ub3V_7g1LFA@mail.gmail.com> 2023-07-05 19:16 ` James Zern 2023-07-06 2:22 ` David Lemler 2023-07-07 16:42 ` James Zern 2023-07-06 7:45 ` Anton Khirnov 2023-07-07 16:41 ` James Zern 2023-07-07 21:31 ` David Lemler [this message] 2023-07-13 19:38 ` James Zern 2023-07-14 16:58 ` James Zern
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=1338627269.18082.1688765464391@localhost \ --to=david@lemler.family \ --cc=ffmpeg-devel@ffmpeg.org \ /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