[FFmpeg-cvslog] hevc: fix key_frame as an IRAP

Mickaël Raulet git at videolan.org
Sat May 17 01:15:21 CEST 2014


ffmpeg | branch: master | Mickaël Raulet <mraulet at insa-rennes.fr> | Sat May 17 01:09:32 2014 +0200| [e2760de60514b949c0a5584d797d933f711f5b14] | committer: Michael Niedermayer

hevc: fix key_frame as an IRAP

it was always 1 before with ISOBMFF(cherry picked from commit fb1402b1ec78d80acd6ced76bf78d65560965c4c)

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e2760de60514b949c0a5584d797d933f711f5b14
---

 libavcodec/hevc.c        |    3 ++-
 libavcodec/hevc_parser.c |    2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c
index 6fadef3..c9fa319 100644
--- a/libavcodec/hevc.c
+++ b/libavcodec/hevc.c
@@ -373,7 +373,7 @@ static int hls_slice_header(HEVCContext *s)
             ff_hevc_clear_refs(s);
     }
     sh->no_output_of_prior_pics_flag = 0;
-    if (s->nal_unit_type >= 16 && s->nal_unit_type <= 23)
+    if (IS_IRAP(s))
         sh->no_output_of_prior_pics_flag = get_bits1(gb);
     if (s->nal_unit_type == NAL_CRA_NUT && s->last_eos == 1)
         sh->no_output_of_prior_pics_flag = 1;
@@ -2862,6 +2862,7 @@ static int hevc_decode_frame(AVCodecContext *avctx, void *data, int *got_output,
     s->is_md5 = 0;
 
     if (s->is_decoded) {
+        s->ref->frame->key_frame = IS_IRAP(s);
         av_log(avctx, AV_LOG_DEBUG, "Decoded frame with POC %d.\n", s->poc);
         s->is_decoded = 0;
     }
diff --git a/libavcodec/hevc_parser.c b/libavcodec/hevc_parser.c
index dc1f6d5..96dbb59 100644
--- a/libavcodec/hevc_parser.c
+++ b/libavcodec/hevc_parser.c
@@ -169,7 +169,7 @@ static inline int parse_nal_units(AVCodecParserContext *s, AVCodecContext *avctx
             s->picture_structure = h->picture_struct;
             s->field_order = h->picture_struct;
 
-            if (h->nal_unit_type >= 16 && h->nal_unit_type <= 23) {
+            if (IS_IRAP(h)) {
                 s->key_frame = 1;
                 sh->no_output_of_prior_pics_flag = get_bits1(gb);
             }



More information about the ffmpeg-cvslog mailing list