diff options
author | Anton Khirnov <anton@khirnov.net> | 2017-07-22 14:52:27 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2017-07-26 23:23:13 +0200 |
commit | 45c4bf3df03ef53ae61fa1473424d4ae024f22e4 (patch) | |
tree | 2cdc3cf57d5a91ddb41348822896221e5e1cfaa0 /libavcodec/h264_slice.c | |
parent | 45df7adc1d9b7e8fbae5af9328baa6ab3562002b (diff) |
h264dec: track the last seen value of x264_build
Do not use the one in the SEI directly as that is reset at certain
points.
Inspired by patches from Michael Niedermayer <michaelni@gmx.at> and
Anton Mitrofanov <BugMaster@narod.ru>.
CC: libav-stable@libav.org
Diffstat (limited to 'libavcodec/h264_slice.c')
-rw-r--r-- | libavcodec/h264_slice.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c index c9f1dbb86f..e7408b24b5 100644 --- a/libavcodec/h264_slice.c +++ b/libavcodec/h264_slice.c @@ -403,6 +403,7 @@ int ff_h264_update_thread_context(AVCodecContext *dst, h->enable_er = h1->enable_er; h->workaround_bugs = h1->workaround_bugs; + h->x264_build = h1->x264_build; h->droppable = h1->droppable; // extradata/NAL handling @@ -509,6 +510,9 @@ static int h264_frame_start(H264Context *h) h->mb_aff_frame = h->ps.sps->mb_aff && (h->picture_structure == PICT_FRAME); + if (h->sei.unregistered.x264_build >= 0) + h->x264_build = h->sei.unregistered.x264_build; + assert(h->cur_pic_ptr->long_ref == 0); return 0; @@ -847,7 +851,7 @@ static int h264_slice_header_init(H264Context *h) if (sps->timing_info_present_flag) { int64_t den = sps->time_scale; - if (h->sei.unregistered.x264_build < 44U) + if (h->x264_build < 44U) den *= 2; av_reduce(&h->avctx->framerate.den, &h->avctx->framerate.num, sps->num_units_in_tick, den, 1 << 30); |