diff options
author | Valery Kot <valery.kot@4cinsights.com> | 2018-03-16 14:50:34 +0100 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2018-04-05 15:59:18 -0300 |
commit | 67fd8df4197e50720223f9715594a1fa31f48b54 (patch) | |
tree | 1bef93c484fab517fd3198d96dcf0b5d4e9b9e96 | |
parent | b08c132a9c590cf5c3905a48b12527765fc91647 (diff) | |
download | ffmpeg-67fd8df4197e50720223f9715594a1fa31f48b54.tar.gz |
avcodec/openh264enc.c: generate IDR frame in response to I frame pict_type
Signed-off-by: Valery Kot <valery.kot@gmail.com>
-rw-r--r-- | libavcodec/libopenh264enc.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/libopenh264enc.c b/libavcodec/libopenh264enc.c index fdadb101f5..83c3f0ce20 100644 --- a/libavcodec/libopenh264enc.c +++ b/libavcodec/libopenh264enc.c @@ -246,6 +246,10 @@ static int svc_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, sp.iPicWidth = avctx->width; 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); if (encoded != cmResultSuccess) { av_log(avctx, AV_LOG_ERROR, "EncodeFrame failed\n"); |