You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
avcodec/h264: mark recovery_cnt==0 frames as keyframes
Fixes Ticket3063 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
@@ -1781,6 +1781,8 @@ static int output_frame(H264Context *h, AVFrame *dst, H264Picture *srcp)
|
|||||||
|
|
||||||
av_dict_set(&dst->metadata, "stereo_mode", ff_h264_sei_stereo_mode(h), 0);
|
av_dict_set(&dst->metadata, "stereo_mode", ff_h264_sei_stereo_mode(h), 0);
|
||||||
|
|
||||||
|
if (srcp->sei_recovery_frame_cnt == 0)
|
||||||
|
dst->key_frame = 1;
|
||||||
if (!srcp->crop)
|
if (!srcp->crop)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
@@ -324,6 +324,7 @@ typedef struct H264Picture {
|
|||||||
int reference;
|
int reference;
|
||||||
int recovered; ///< picture at IDR or recovery point + recovery count
|
int recovered; ///< picture at IDR or recovery point + recovery count
|
||||||
int invalid_gap;
|
int invalid_gap;
|
||||||
|
int sei_recovery_frame_cnt;
|
||||||
|
|
||||||
int crop;
|
int crop;
|
||||||
int crop_left;
|
int crop_left;
|
||||||
|
@@ -122,6 +122,7 @@ int ff_h264_ref_picture(H264Context *h, H264Picture *dst, H264Picture *src)
|
|||||||
dst->crop_top = src->crop_top;
|
dst->crop_top = src->crop_top;
|
||||||
dst->recovered = src->recovered;
|
dst->recovered = src->recovered;
|
||||||
dst->invalid_gap = src->invalid_gap;
|
dst->invalid_gap = src->invalid_gap;
|
||||||
|
dst->sei_recovery_frame_cnt = src->sei_recovery_frame_cnt;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
fail:
|
fail:
|
||||||
|
@@ -744,6 +744,7 @@ static int h264_frame_start(H264Context *h)
|
|||||||
pic->mmco_reset = 0;
|
pic->mmco_reset = 0;
|
||||||
pic->recovered = 0;
|
pic->recovered = 0;
|
||||||
pic->invalid_gap = 0;
|
pic->invalid_gap = 0;
|
||||||
|
pic->sei_recovery_frame_cnt = h->sei_recovery_frame_cnt;
|
||||||
|
|
||||||
if ((ret = alloc_picture(h, pic)) < 0)
|
if ((ret = alloc_picture(h, pic)) < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
Reference in New Issue
Block a user