hw_frames_ctx on the input link is only set when the input link is configured, which hasn't happened yet. This temporarily hacks around the problem (in a way no worse than before the format negotiation changes) until a proper fix can be applied.
Showing the changes to libavfilter/avfiltergraph.c (1 of 1 file). Show all
Unified · Split
| @@ -667,8 +667,12 @@ static int pick_format(AVFilterLink *link, AVFilterLink *ref) · 666 unmodified lines | ||
| 667 | 667 | if (link->type == AVMEDIA_TYPE_VIDEO) { |
| 668 | 668 | enum AVPixelFormat swfmt = link->format; |
| 669 | 669 | if (av_pix_fmt_desc_get(swfmt)->flags & AV_PIX_FMT_FLAG_HWACCEL) { |
| 670 | − av_assert1(link->hw_frames_ctx); | |
| 671 | − swfmt = ((AVHWFramesContext *) link->hw_frames_ctx->data)->sw_format; | |
| 670 | + // FIXME: this is a hack - we'd like to use the sw_format of | |
| 671 | + // link->hw_frames_ctx here, but it is not yet available. | |
| 672 | + // To make this work properly we will need to either reorder | |
| 673 | + // things so that it is available here or somehow negotiate | |
| 674 | + // sw_format separately. | |
| 675 | + swfmt = AV_PIX_FMT_YUV420P; | |
| 672 | 676 | } |
| 673 | 677 | |
| 674 | 678 | if (!ff_fmt_is_regular_yuv(swfmt)) { |