Invalidate the whole struct on SEI reset.
Showing the changes to libavcodec (3 of 3 files). Show all
Unified · Split
| @@ -4106,7 +4106,7 @@ static int hevc_sei_to_context(AVCodecContext *avctx, HEVCSEI *sei) · 4105 unmodified lines | ||
| 4106 | 4106 | { |
| 4107 | 4107 | int ret; |
| 4108 | 4108 | |
| 4109 | − if (sei->tdrdi.num_ref_displays) { | |
| 4109 | + if (sei->tdrdi.present) { | |
| 4110 | 4110 | AVBufferRef *buf; |
| 4111 | 4111 | size_t size; |
| 4112 | 4112 | AV3DReferenceDisplaysInfo *tdrdi = av_tdrdi_alloc(sei->tdrdi.num_ref_displays, &size); |
| @@ -217,6 +217,8 @@ static int decode_nal_sei_3d_reference_displays_info(HEVCSEITDRDI *s, GetBitCont · 216 unmodified lines | ||
| 217 | 217 | } |
| 218 | 218 | s->three_dimensional_reference_displays_extension_flag = get_bits1(gb); |
| 219 | 219 | |
| 220 | + s->present = 1; | |
| 221 | + | |
| 220 | 222 | return 0; |
| 221 | 223 | } |
| 222 | 224 | |
| @@ -93,6 +93,7 @@ typedef struct HEVCSEITDRDI { · 92 unmodified lines | ||
| 93 | 93 | uint8_t additional_shift_present_flag[32]; |
| 94 | 94 | int16_t num_sample_shift[32]; |
| 95 | 95 | uint8_t three_dimensional_reference_displays_extension_flag; |
| 96 | + int present; | |
| 96 | 97 | } HEVCSEITDRDI; |
| 97 | 98 | |
| 98 | 99 | typedef struct HEVCSEIRecoveryPoint { |
| @@ -126,6 +127,7 @@ int ff_hevc_decode_nal_sei(GetBitContext *gb, void *logctx, HEVCSEI *s, · 27 unmodified lines | ||
| 126 | 127 | */ |
| 127 | 128 | static inline void ff_hevc_reset_sei(HEVCSEI *sei) |
| 128 | 129 | { |
| 130 | + sei->tdrdi.present = 0; | |
| 129 | 131 | ff_h2645_sei_reset(&sei->common); |
| 130 | 132 | } |
| 131 | 133 | |