h264_sei: parse the picture timing SEIs correctly

Those SEIs refer to the currently active SPS. However, since the SEI
NALUs precede the coded picture data in the bitstream, the active SPS is
in general not known when we are decoding the SEI.

Therefore, store the content of the picture timing SEIs and actually
parse it when the active SPS is known.
This commit is contained in:
Anton Khirnov
2017-05-19 10:44:59 +02:00
parent 1e9615c5d4
commit ec7f33a38e
4 changed files with 78 additions and 34 deletions

View File

@@ -481,6 +481,15 @@ static inline int parse_nal_units(AVCodecParserContext *s,
}
}
if (p->sei.picture_timing.present) {
ret = ff_h264_sei_process_picture_timing(&p->sei.picture_timing,
sps, avctx);
if (ret < 0) {
av_log(avctx, AV_LOG_ERROR, "Error processing the picture timing SEI\n");
p->sei.picture_timing.present = 0;
}
}
if (sps->pic_struct_present_flag && p->sei.picture_timing.present) {
switch (p->sei.picture_timing.pic_struct) {
case H264_SEI_PIC_STRUCT_TOP_FIELD: