Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 2 additions & 14 deletions plugins/obs-ffmpeg/texture-amf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1720,8 +1720,8 @@ static void amf_avc_create_internal(amf_base *enc, obs_data_t *settings)
amf_int64 b_max = 0;

if (get_avc_property(enc, B_PIC_PATTERN, &b_frames) &&
get_avc_property(enc, MAX_CONSECUTIVE_BPICTURES, &b_max)) {
enc->dts_offset = b_frames + 1;
get_avc_property(enc, MAX_CONSECUTIVE_BPICTURES, &b_max) && b_frames > 0) {
enc->dts_offset = std::min(b_frames, b_max) + 1;
} else {
enc->dts_offset = 0;
}
Expand Down Expand Up @@ -2543,18 +2543,6 @@ static void amf_av1_create_internal(amf_base *enc, obs_data_t *settings)
if (res == AMF_OK && p.type == AMF_VARIANT_INTERFACE) {
enc->header = AMFBufferPtr(p.pInterface);
}

if (enc->bframes_supported) {
amf_int64 b_frames = 0;
amf_int64 b_max = 0;

if (get_av1_property(enc, B_PIC_PATTERN, &b_frames) &&
get_av1_property(enc, MAX_CONSECUTIVE_BPICTURES, &b_max)) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For AV1 this code shouldn't exist at all because it doesn't use frame-reordering. See also a similar change for NVIDIA here: #10996

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, good catch. I've reviewed the code paths and we can safely remove the dts_offset code for AV1 here. It's removed with the last push.

enc->dts_offset = b_frames + 1;
} else {
enc->dts_offset = 0;
}
}
}

static void *amf_av1_create_texencode(obs_data_t *settings, obs_encoder_t *encoder)
Expand Down
Loading