mirror of
https://gitee.com/openharmony/third_party_ffmpeg
synced 2025-02-11 07:05:43 +00:00
avcodec/openh264enc.c: generate IDR frame in response to I frame pict_type
Signed-off-by: Valery Kot <valery.kot@gmail.com>
This commit is contained in:
parent
b08c132a9c
commit
67fd8df419
@ -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");
|
||||
|
Loading…
x
Reference in New Issue
Block a user