Downstream can determine the format from the output frame format
Showing the changes to libavcodec (1 of 1 file). Show all
Unified · Split
| @@ -961,19 +961,6 @@ fail: · 960 unmodified lines | ||
| 961 | 961 | return ret; |
| 962 | 962 | } |
| 963 | 963 | |
| 964 | −static int set_output_format(const VVCContext *s, const AVFrame *output) | |
| 965 | −{ | |
| 966 | − AVCodecContext *c = s->avctx; | |
| 967 | − int ret; | |
| 968 | − | |
| 969 | − if (output->width != c->width || output->height != c->height) { | |
| 970 | − if ((ret = ff_set_dimensions(c, output->width, output->height)) < 0) | |
| 971 | − return ret; | |
| 972 | − } | |
| 973 | − c->pix_fmt = output->format; | |
| 974 | − return 0; | |
| 975 | −} | |
| 976 | − | |
| 977 | 964 | static int wait_delayed_frame(VVCContext *s, AVFrame *output, int *got_output) |
| 978 | 965 | { |
| 979 | 966 | VVCFrameContext *delayed = get_frame_context(s, s->fcs, s->nb_frames - s->nb_delayed); |
| @@ -981,9 +968,7 @@ static int wait_delayed_frame(VVCContext *s, AVFrame *output, int *got_output) · 1 unmodified line | ||
| 981 | 968 | |
| 982 | 969 | if (!ret && delayed->output_frame->buf[0] && output) { |
| 983 | 970 | av_frame_move_ref(output, delayed->output_frame); |
| 984 | − ret = set_output_format(s, output); | |
| 985 | − if (!ret) | |
| 986 | − *got_output = 1; | |
| 971 | + *got_output = 1; | |
| 987 | 972 | } |
| 988 | 973 | s->nb_delayed--; |
| 989 | 974 | |
| @@ -1034,11 +1019,7 @@ static int get_decoded_frame(VVCContext *s, AVFrame *output, int *got_output) · 44 unmodified lines | ||
| 1034 | 1019 | ret = ff_vvc_output_frame(s, last, output, 0, 1); |
| 1035 | 1020 | if (ret < 0) |
| 1036 | 1021 | return ret; |
| 1037 | − if (ret) { | |
| 1038 | − *got_output = ret; | |
| 1039 | − if ((ret = set_output_format(s, output)) < 0) | |
| 1040 | − return ret; | |
| 1041 | − } | |
| 1022 | + *got_output = ret; | |
| 1042 | 1023 | } |
| 1043 | 1024 | return 0; |
| 1044 | 1025 | } |