This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

commit c29206e456f07e9ce11a11a34d801c23c2824290
Author:     Jun Zhao <[email protected]>
AuthorDate: Mon Mar 9 08:46:45 2026 +0800
Commit:     toots <[email protected]>
CommitDate: Wed Mar 18 02:08:09 2026 +0000

    doc/examples/transcode: query encoder for supported configs
    
    avcodec_get_supported_config() is called with dec_ctx (the decoder
    context) to query supported pixel formats and sample formats, but
    the intent is to configure the encoder. The decoder supported
    format list may differ from the encoder, leading to format
    negotiation failures or incorrect output.
    
    Pass enc_ctx instead so the actual encoder capabilities are
    queried.
    
    Signed-off-by: Jun Zhao <[email protected]>
---
 doc/examples/transcode.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/examples/transcode.c b/doc/examples/transcode.c
index 1dc1b50502..5cad3e1aec 100644
--- a/doc/examples/transcode.c
+++ b/doc/examples/transcode.c
@@ -177,7 +177,7 @@ static int open_output_file(const char *filename)
                 enc_ctx->width = dec_ctx->width;
                 enc_ctx->sample_aspect_ratio = dec_ctx->sample_aspect_ratio;
 
-                ret = avcodec_get_supported_config(dec_ctx, NULL,
+                ret = avcodec_get_supported_config(enc_ctx, NULL,
                                                    AV_CODEC_CONFIG_PIX_FORMAT, 
0,
                                                    (const void**)&pix_fmts, 
NULL);
 
@@ -195,7 +195,7 @@ static int open_output_file(const char *filename)
                 if (ret < 0)
                     return ret;
 
-                ret = avcodec_get_supported_config(dec_ctx, NULL,
+                ret = avcodec_get_supported_config(enc_ctx, NULL,
                                                    
AV_CODEC_CONFIG_SAMPLE_FORMAT, 0,
                                                    (const void**)&sample_fmts, 
NULL);
 

_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to