[PATCH] avcodec/h264: mark recovery_cnt==0 frames as keyframes
Fixes Ticket3063 Signed-off-by: Michael Niedermayer <michaelni@gmx.at> --- libavcodec/h264.c | 4 ++++ libavcodec/mpegvideo.h | 1 + 2 files changed, 5 insertions(+) diff --git a/libavcodec/h264.c b/libavcodec/h264.c index d0d32d3..06a9453 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -365,6 +365,7 @@ static int ref_picture(H264Context *h, Picture *dst, Picture *src) dst->crop_left = src->crop_left; dst->crop_top = src->crop_top; dst->recovered = src->recovered; + dst->sei_recovery_frame_cnt = src->sei_recovery_frame_cnt; return 0; fail: @@ -1963,6 +1964,7 @@ static int h264_frame_start(H264Context *h) pic->f.key_frame = 0; pic->mmco_reset = 0; pic->recovered = 0; + pic->sei_recovery_frame_cnt = h->sei_recovery_frame_cnt; if ((ret = alloc_picture(h, pic)) < 0) return ret; @@ -5043,6 +5045,8 @@ static int output_frame(H264Context *h, AVFrame *dst, Picture *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/mpegvideo.h b/libavcodec/mpegvideo.h index 8ba1321..66449ae 100644 --- a/libavcodec/mpegvideo.h +++ b/libavcodec/mpegvideo.h @@ -177,6 +177,7 @@ typedef struct Picture{ int reference; int shared; int recovered; ///< Picture at IDR or recovery point + recovery count + int sei_recovery_frame_cnt; int crop; int crop_left; -- 1.7.9.5
Michael Niedermayer <michaelni <at> gmx.at> writes:
Fixes Ticket3063
Ping, what happened to this patch? Carl Eugen
On Sat, May 03, 2014 at 08:16:53AM +0000, Carl Eugen Hoyos wrote:
Michael Niedermayer <michaelni <at> gmx.at> writes:
Fixes Ticket3063
Ping, what happened to this patch?
seems ive forgotten about it applied thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB The greatest way to live with honor in this world is to be what we pretend to be. -- Socrates
participants (2)
-
Carl Eugen Hoyos -
Michael Niedermayer