Fixed error recovery causing corrupt packets

This commit is contained in:
loki 2019-12-10 01:20:37 +01:00
commit 6f384f49df
2 changed files with 12 additions and 40 deletions

View file

@ -126,6 +126,7 @@ void encodeThread(
yuv_frame->width = ctx->width;
yuv_frame->height = ctx->height;
// yuv_frame->opaque = 0;
av_frame_get_buffer(yuv_frame.get(), 0);
int64_t frame = 1;
@ -144,8 +145,9 @@ void encodeThread(
while (auto img = images->pop()) {
if(idr_events->peek()) {
yuv_frame->pict_type = AV_PICTURE_TYPE_I;
frame = idr_events->pop()->first;
// ++yuv_frame->opaque;
}
encode(frame++, ctx, sws, yuv_frame, img, packets);