This is a temporary workaround to allow deprecating avcodec_get_frame_defaults(). The proper solution will be using a properly allocated AVFrame in Picture.
Unified · Split
| @@ -1036,14 +1036,14 @@ av_cold int ff_MPV_common_init(MpegEncContext *s) · 1035 unmodified lines | ||
| 1036 | 1036 | FF_ALLOCZ_OR_GOTO(s->avctx, s->picture, |
| 1037 | 1037 | MAX_PICTURE_COUNT * sizeof(Picture), fail); |
| 1038 | 1038 | for (i = 0; i < MAX_PICTURE_COUNT; i++) { |
| 1039 | − avcodec_get_frame_defaults(&s->picture[i].f); | |
| 1039 | + av_frame_unref(&s->picture[i].f); | |
| 1040 | 1040 | } |
| 1041 | 1041 | memset(&s->next_picture, 0, sizeof(s->next_picture)); |
| 1042 | 1042 | memset(&s->last_picture, 0, sizeof(s->last_picture)); |
| 1043 | 1043 | memset(&s->current_picture, 0, sizeof(s->current_picture)); |
| 1044 | − avcodec_get_frame_defaults(&s->next_picture.f); | |
| 1045 | − avcodec_get_frame_defaults(&s->last_picture.f); | |
| 1046 | − avcodec_get_frame_defaults(&s->current_picture.f); | |
| 1044 | + av_frame_unref(&s->next_picture.f); | |
| 1045 | + av_frame_unref(&s->last_picture.f); | |
| 1046 | + av_frame_unref(&s->current_picture.f); | |
| 1047 | 1047 | |
| 1048 | 1048 | if (s->width && s->height) { |
| 1049 | 1049 | if (init_context_frame(s)) |