Commit 67fd8df4 authored by Valery Kot's avatar Valery Kot Committed by James Almer

avcodec/openh264enc.c: generate IDR frame in response to I frame pict_type

Signed-off-by: 's avatarValery Kot <valery.kot@gmail.com>
parent b08c132a
...@@ -246,6 +246,10 @@ static int svc_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, ...@@ -246,6 +246,10 @@ static int svc_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
sp.iPicWidth = avctx->width; sp.iPicWidth = avctx->width;
sp.iPicHeight = avctx->height; sp.iPicHeight = avctx->height;
if (frame->pict_type == AV_PICTURE_TYPE_I) {
(*s->encoder)->ForceIntraFrame(s->encoder, true);
}
encoded = (*s->encoder)->EncodeFrame(s->encoder, &sp, &fbi); encoded = (*s->encoder)->EncodeFrame(s->encoder, &sp, &fbi);
if (encoded != cmResultSuccess) { if (encoded != cmResultSuccess) {
av_log(avctx, AV_LOG_ERROR, "EncodeFrame failed\n"); av_log(avctx, AV_LOG_ERROR, "EncodeFrame failed\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment