Skip to content

Commit 7f96f98

Browse files
author
Daniel Flores
committed
add comment explaining nb_elements
1 parent c5fa1e1 commit 7f96f98

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/torchcodec/_core/FFMPEGCommon.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include "src/torchcodec/_core/FFMPEGCommon.h"
88

99
#include <c10/util/Exception.h>
10+
1011
extern "C" {
1112
#include <libavfilter/avfilter.h>
1213
#include <libavfilter/buffersink.h>
@@ -398,6 +399,8 @@ AVFilterContext* createBuffersinkFilter(
398399
TORCH_CHECK(
399400
sinkContext != nullptr, "Failed to allocate buffersink filter context.");
400401

402+
// When setting pix_fmts, only the first element is used, so nb_elems = 1
403+
// AV_PIX_FMT_NONE acts as a terminator for the array in av_opt_set_int_list
401404
status = av_opt_set_array(
402405
sinkContext,
403406
"pixel_formats",

0 commit comments

Comments
 (0)