aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/h264_parser.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2017-05-19 10:44:59 +0200
committerAnton Khirnov <anton@khirnov.net>2020-04-10 15:52:22 +0200
commitec7f33a38e341807c0ff9530e4dc7e175a86f437 (patch)
treeecb68bac55d7bfd820da689579ccf4cd2b29f3f8 /libavcodec/h264_parser.c
parent1e9615c5d4d1697816037057133b20da4fd9e57b (diff)
downloadffmpeg-ec7f33a38e341807c0ff9530e4dc7e175a86f437.tar.gz
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.
Diffstat (limited to 'libavcodec/h264_parser.c')
-rw-r--r--libavcodec/h264_parser.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/libavcodec/h264_parser.c b/libavcodec/h264_parser.c
index 5f9a9c46ef..ec1cbc6a66 100644
--- a/libavcodec/h264_parser.c
+++ b/libavcodec/h264_parser.c
@@ -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: