Rework vaapi/nvenc/x264 IDR handling

Fix race conditions with should_skip
detect if nothings goes out from decoder and issue an IDR
remove idr_received, go directly to running state
This commit is contained in:
Patrick Nicolas
2026-10-05 22:27:15 +02:00
parent 4ea97485cc
commit 2fc4708bc6
8 changed files with 54 additions and 39 deletions
@@ -82,7 +82,7 @@ std::optional<wivrn::video_encoder::data> video_encoder_ffmpeg::encode(uint8_t s
encoder_ctx->framerate = AVRational{.num = int(framerate * 1000), .den = 1000};
}
bool is_idr = idr_handler.get_type(frame_index) == default_idr_handler::frame_type::i;
bool is_idr = idr_handler.get_type(frame_index, stream_idx) == default_idr_handler::frame_type::i;
std::shared_ptr<AVPacket> enc_pkt(av_packet_alloc(), [](AVPacket * d) { av_packet_free(&d); });
int err;