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.
Unified · Split
| @@ -667,8 +667,12 @@ static int pick_format(AVFilterLink *link, AVFilterLink *ref) · 666 unmodified lines | |||
| 667 | if (link->type == AVMEDIA_TYPE_VIDEO) { | 667 | if (link->type == AVMEDIA_TYPE_VIDEO) { |
| 668 | enum AVPixelFormat swfmt = link->format; | 668 | enum AVPixelFormat swfmt = link->format; |
| 669 | if (av_pix_fmt_desc_get(swfmt)->flags & AV_PIX_FMT_FLAG_HWACCEL) { | 669 | if (av_pix_fmt_desc_get(swfmt)->flags & AV_PIX_FMT_FLAG_HWACCEL) { |
| 670 | av_assert1(link->hw_frames_ctx); | 670 | // FIXME: this is a hack - we'd like to use the sw_format of |
| 671 | swfmt = ((AVHWFramesContext *) link->hw_frames_ctx->data)->sw_format; | 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 | if (!ff_fmt_is_regular_yuv(swfmt)) { | 678 | if (!ff_fmt_is_regular_yuv(swfmt)) { |