diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-11-03 17:24:05 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-05-03 16:01:45 +0200 |
commit | 7ef01a7878149de43aa49e676a343ca67b24c6b2 (patch) | |
tree | b8c02a321d99ea3a448d3e9c3cac29d8da96af3d /libavcodec | |
parent | a75349d0c833da6828c8a8261516d94e705633d6 (diff) | |
download | ffmpeg-streaming-7ef01a7878149de43aa49e676a343ca67b24c6b2.zip ffmpeg-streaming-7ef01a7878149de43aa49e676a343ca67b24c6b2.tar.gz |
avcodec/h264: mark recovery_cnt==0 frames as keyframes
Fixes Ticket3063
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/h264.c | 2 | ||||
-rw-r--r-- | libavcodec/h264.h | 1 | ||||
-rw-r--r-- | libavcodec/h264_picture.c | 1 | ||||
-rw-r--r-- | libavcodec/h264_slice.c | 1 |
4 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c index dd70af3..942ba7f 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -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); + if (srcp->sei_recovery_frame_cnt == 0) + dst->key_frame = 1; if (!srcp->crop) return 0; diff --git a/libavcodec/h264.h b/libavcodec/h264.h index 70539bb..76f111b 100644 --- a/libavcodec/h264.h +++ b/libavcodec/h264.h @@ -324,6 +324,7 @@ typedef struct H264Picture { int reference; int recovered; ///< picture at IDR or recovery point + recovery count int invalid_gap; + int sei_recovery_frame_cnt; int crop; int crop_left; diff --git a/libavcodec/h264_picture.c b/libavcodec/h264_picture.c index 36028dc..61ff862 100644 --- a/libavcodec/h264_picture.c +++ b/libavcodec/h264_picture.c @@ -122,6 +122,7 @@ int ff_h264_ref_picture(H264Context *h, H264Picture *dst, H264Picture *src) dst->crop_top = src->crop_top; dst->recovered = src->recovered; dst->invalid_gap = src->invalid_gap; + dst->sei_recovery_frame_cnt = src->sei_recovery_frame_cnt; return 0; fail: diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c index 65e8c73..c70814f 100644 --- a/libavcodec/h264_slice.c +++ b/libavcodec/h264_slice.c @@ -744,6 +744,7 @@ static int h264_frame_start(H264Context *h) pic->mmco_reset = 0; pic->recovered = 0; pic->invalid_gap = 0; + pic->sei_recovery_frame_cnt = h->sei_recovery_frame_cnt; if ((ret = alloc_picture(h, pic)) < 0) return ret; |