On 2016-06-09 10:30:14 +0200, Anton Khirnov wrote:
> This is a more appropriate place for this. H264Context.recovery_frame is
> shared between frame threads, so modifying it where it is right now is
> invalid.
> ---
>  libavcodec/h264_slice.c | 18 ++++++++++++++++++
>  libavcodec/h264dec.c    | 18 ------------------
>  2 files changed, 18 insertions(+), 18 deletions(-)
> 
> diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
> index 4910396..2b7e088 100644
> --- a/libavcodec/h264_slice.c
> +++ b/libavcodec/h264_slice.c
> @@ -1335,6 +1335,24 @@ static int h264_field_start(H264Context *h, const 
> H264SliceContext *sl,
>  
>      h->picture_idr = nal->type == H264_NAL_IDR_SLICE;
>  
> +    if (h->sei.recovery_point.recovery_frame_cnt >= 0 && h->recovery_frame < 
> 0) {
> +        h->recovery_frame = (h->poc.frame_num + 
> h->sei.recovery_point.recovery_frame_cnt) &
> +                            ((1 << h->ps.sps->log2_max_frame_num) - 1);
> +    }
> +
> +    h->cur_pic_ptr->f->key_frame |= (nal->type == H264_NAL_IDR_SLICE) ||
> +                                    
> (h->sei.recovery_point.recovery_frame_cnt >= 0);
> +
> +    if (nal->type == H264_NAL_IDR_SLICE || h->recovery_frame == 
> h->poc.frame_num) {
> +        h->recovery_frame         = -1;
> +        h->cur_pic_ptr->recovered = 1;
> +    }
> +    // If we have an IDR, all frames after it in decoded order are
> +    // "recovered".
> +    if (nal->type == H264_NAL_IDR_SLICE)
> +        h->frame_recovered |= FRAME_RECOVERED_IDR;
> +    h->cur_pic_ptr->recovered |= !!(h->frame_recovered & 
> FRAME_RECOVERED_IDR);

unrelated, the recovery point code seems to like setting variables 
redundantly.

patch ok and all patches without explicit ok from me looked ok too

Janne
_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to