diff mbox series

[FFmpeg-devel,07/10] doc/examples/transcode: handle audio encoder frame size restrictions

Message ID 20240925132921.11203-7-anton@khirnov.net
State New
Headers show
Series [FFmpeg-devel,01/10] fftools/ffmpeg_filter: stop using avfilter_graph_alloc_filter() incorrectly | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Anton Khirnov Sept. 25, 2024, 1:29 p.m. UTC
---
 doc/examples/transcode.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/doc/examples/transcode.c b/doc/examples/transcode.c
index 54fb315236..1dc1b50502 100644
--- a/doc/examples/transcode.c
+++ b/doc/examples/transcode.c
@@ -374,6 +374,9 @@  static int init_filter(FilteringContext* fctx, AVCodecContext *dec_ctx,
             goto end;
         }
 
+        if (enc_ctx->frame_size > 0)
+            av_buffersink_set_frame_size(buffersink_ctx, enc_ctx->frame_size);
+
         ret = avfilter_init_dict(buffersink_ctx, NULL);
         if (ret < 0) {
             av_log(NULL, AV_LOG_ERROR, "Cannot initialize audio buffer sink\n");