summaryrefslogtreecommitdiff
path: root/libavcodec/h264_slice.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/h264_slice.c')
-rw-r--r--libavcodec/h264_slice.c5
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 ||