| 2898 | } |
| 2899 | |
| 2900 | static int wpp_progress_init(HEVCContext *s, unsigned count) |
| 2901 | { |
| 2902 | if (s->nb_wpp_progress < count) { |
| 2903 | void *tmp = av_realloc_array(s->wpp_progress, count, |
| 2904 | sizeof(*s->wpp_progress)); |
| 2905 | if (!tmp) |
| 2906 | return AVERROR(ENOMEM); |
| 2907 | |
| 2908 | s->wpp_progress = tmp; |
| 2909 | memset(s->wpp_progress + s->nb_wpp_progress, 0, |
| 2910 | (count - s->nb_wpp_progress) * sizeof(*s->wpp_progress)); |
| 2911 | |
| 2912 | for (int i = s->nb_wpp_progress; i < count; i++) { |
| 2913 | int ret = ff_thread_progress_init(&s->wpp_progress[i], 1); |
| 2914 | if (ret < 0) |
| 2915 | return ret; |
| 2916 | s->nb_wpp_progress = i + 1; |
| 2917 | } |
| 2918 | } |
| 2919 | |
| 2920 | for (int i = 0; i < count; i++) |
| 2921 | ff_thread_progress_reset(&s->wpp_progress[i]); |
| 2922 | |
| 2923 | return 0; |
| 2924 | } |
| 2925 | |
| 2926 | static int hls_slice_data_wpp(HEVCContext *s, const H2645NAL *nal) |
| 2927 | { |
no test coverage detected