Skip to content

Commit 3c16751

Browse files
committed
vcomp/lavc/amf: fixed auto header insert for H264
The commit 8737896 from 2024-07-10 has actually broken this because the header_inserter_req value changed in temporary struct since that, not in the one that is stored in state. Fixed by adding the actual value, alongside the _req value in parameters.
1 parent 55712e2 commit 3c16751

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/video_compress/libavcodec.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,7 @@ struct state_video_compress_libav {
289289
codec_t requested_codec_id = VIDEO_CODEC_NONE;
290290
struct to_lavc_req_prop req_conv_prop{ TO_LAVC_REQ_PROP_INIT };
291291
bool store_orig_format = false;
292+
bool header_inserter = false;
292293
struct aux_header aux_header;
293294

294295
struct video_desc compressed_desc{};
@@ -949,6 +950,7 @@ bool set_codec_ctx_params(struct state_video_compress_libav *s, AVPixelFormat pi
949950
params.slices, s->codec_ctx->codec_id == AV_CODEC_ID_FFV1
950951
? 16
951952
: DEFAULT_SLICE_COUNT);
953+
s->header_inserter = params.header_inserter_req == 1;
952954

953955
// set user supplied parameters
954956
for (auto const &item : s->lavc_opts) {
@@ -1495,7 +1497,7 @@ auto out_vf_from_pkt(state_video_compress_libav *s, AVPacket *pkt) {
14951497
memcpy(out->tiles[0].data, s->aux_header.buf, s->aux_header.buf_len);
14961498
memcpy(out->tiles[0].data + s->aux_header.buf_len, pkt->data,
14971499
pkt->size);
1498-
if (s->params.header_inserter_req == 1) {
1500+
if (s->params.header) {
14991501
store_sps_pps_vps(s, pkt);
15001502
}
15011503

0 commit comments

Comments
 (0)