This makes it easier for users of the CBS API to get alloc/free right - all subelements use the buffer API so that it's clear how to free them. It also allows eliding some redundant copies: the packet -> fragment copy disappears after this change if the input packet is refcounted, and more codec-specific cases are now possible (but not included in this patch).
Showing the changes to libavcodec/vaapi_encode_mpeg2.c (1 of 15 files). Show all
Unified · Split
| @@ -92,7 +92,7 @@ static int vaapi_encode_mpeg2_add_header(AVCodecContext *avctx, · 91 unmodified lines | |||
| 92 | VAAPIEncodeMPEG2Context *priv = ctx->priv_data; | 92 | VAAPIEncodeMPEG2Context *priv = ctx->priv_data; |
| 93 | int err; | 93 | int err; |
| 94 | 94 | ||
| 95 | err = ff_cbs_insert_unit_content(priv->cbc, frag, -1, type, header); | 95 | err = ff_cbs_insert_unit_content(priv->cbc, frag, -1, type, header, NULL); |
| 96 | if (err < 0) { | 96 | if (err < 0) { |
| 97 | av_log(avctx, AV_LOG_ERROR, "Failed to add header: " | 97 | av_log(avctx, AV_LOG_ERROR, "Failed to add header: " |
| 98 | "type = %d.\n", type); | 98 | "type = %d.\n", type); |