diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2017-02-15 11:34:52 -0500 |
---|---|---|
committer | Vittorio Giovara <vittorio.giovara@gmail.com> | 2017-02-28 10:32:50 -0500 |
commit | d7b2bb5391bf55e8f9421bff7feb4c1fddfac4bf (patch) | |
tree | 2b9c3aafaab1eacac14fa98759ba5c89178d060f /libavcodec/h264_slice.c | |
parent | 21cca00dfeaec08ca93cf94ed33f4311cf1d8c84 (diff) |
h264_sei: Check actual presence of picture timing SEI message
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Diffstat (limited to 'libavcodec/h264_slice.c')
-rw-r--r-- | libavcodec/h264_slice.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c index f1f5fc05f9..427cbe618c 100644 --- a/libavcodec/h264_slice.c +++ b/libavcodec/h264_slice.c @@ -1004,7 +1004,7 @@ static int h264_export_frame_props(H264Context *h) /* Prioritize picture timing SEI information over used * decoding process if it exists. */ - if (sps->pic_struct_present_flag) { + if (sps->pic_struct_present_flag && h->sei.picture_timing.present) { H264SEIPictureTiming *pt = &h->sei.picture_timing; switch (pt->pic_struct) { case SEI_PIC_STRUCT_FRAME: @@ -1049,7 +1049,8 @@ static int h264_export_frame_props(H264Context *h) /* Derive top_field_first from field pocs. */ cur->f->top_field_first = cur->field_poc[0] < cur->field_poc[1]; } else { - if (cur->f->interlaced_frame || sps->pic_struct_present_flag) { + if (cur->f->interlaced_frame || + (sps->pic_struct_present_flag && h->sei.picture_timing.present)) { /* Use picture timing SEI information. Even if it is a * information of a past frame, better than nothing. */ if (h->sei.picture_timing.pic_struct == SEI_PIC_STRUCT_TOP_BOTTOM || |