mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-09-20 05:16:38 +00:00
avcodec/qtrleenc: Use keyframe when no previous frame is available
If keeping a reference to an earlier frame failed, the next frame must
be an I frame for lack of reference frame. This commit implements this.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
(cherry picked from commit d5fc16a6a8
)
This commit is contained in:
parent
67e401e3cb
commit
6614f33a0b
@ -369,7 +369,8 @@ static int qtrle_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
|
||||
if ((ret = ff_alloc_packet2(avctx, pkt, s->max_buf_size, 0)) < 0)
|
||||
return ret;
|
||||
|
||||
if (avctx->gop_size == 0 || (s->avctx->frame_number % avctx->gop_size) == 0) {
|
||||
if (avctx->gop_size == 0 || !s->previous_frame->data[0] ||
|
||||
(s->avctx->frame_number % avctx->gop_size) == 0) {
|
||||
/* I-Frame */
|
||||
s->key_frame = 1;
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user