diff options
author | Anton Khirnov <[email protected]> | 2024-03-23 13:50:46 +0100 |
---|---|---|
committer | Anton Khirnov <[email protected]> | 2024-03-27 11:35:27 +0100 |
commit | fabf148578c0d628a9207de3b60aba57ac1c4bc3 (patch) | |
tree | 6b3b318968c066c3a1beb20e654e4282c4b0c58b | |
parent | 2621be35397291c03c9a48c28e9283404899868a (diff) |
fftools/ffmpeg_enc: only promote first frame side data to global when meaningful
Skip those side data types that do not make sense as global side data.
-rw-r--r-- | fftools/ffmpeg_enc.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/fftools/ffmpeg_enc.c b/fftools/ffmpeg_enc.c index 5f7fcf8a5f..bcd88c7d3e 100644 --- a/fftools/ffmpeg_enc.c +++ b/fftools/ffmpeg_enc.c @@ -247,6 +247,11 @@ int enc_open(void *opaque, const AVFrame *frame) enc_ctx->chroma_sample_location = frame->chroma_location; for (int i = 0; i < frame->nb_side_data; i++) { + const AVSideDataDescriptor *desc = av_frame_side_data_desc(frame->side_data[i]->type); + + if (!(desc->props & AV_SIDE_DATA_PROP_GLOBAL)) + continue; + ret = av_frame_side_data_clone( &enc_ctx->decoded_side_data, &enc_ctx->nb_decoded_side_data, frame->side_data[i], AV_FRAME_SIDE_DATA_FLAG_UNIQUE); |