diff options
author | Mark Thompson <sw@jkqxz.net> | 2024-01-03 20:40:19 +0000 |
---|---|---|
committer | Mark Thompson <sw@jkqxz.net> | 2024-01-04 21:47:38 +0000 |
commit | 8b76bae8961c3045fa73aa2da47345c70a93d599 (patch) | |
tree | 93e8d6d973f0563eafe899f9c91e2270743e1674 /libavfilter/avfiltergraph.c | |
parent | d1785395323f5506ae18ecc4c87d981b9f91af74 (diff) | |
download | ffmpeg-8b76bae8961c3045fa73aa2da47345c70a93d599.tar.gz |
avfilter: Temporary hack to fix format negotiation for hw formats
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.
Diffstat (limited to 'libavfilter/avfiltergraph.c')
-rw-r--r-- | libavfilter/avfiltergraph.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libavfilter/avfiltergraph.c b/libavfilter/avfiltergraph.c index 727eff81ee..96aa137e6d 100644 --- a/libavfilter/avfiltergraph.c +++ b/libavfilter/avfiltergraph.c @@ -667,8 +667,12 @@ static int pick_format(AVFilterLink *link, AVFilterLink *ref) if (link->type == AVMEDIA_TYPE_VIDEO) { enum AVPixelFormat swfmt = link->format; if (av_pix_fmt_desc_get(swfmt)->flags & AV_PIX_FMT_FLAG_HWACCEL) { - av_assert1(link->hw_frames_ctx); - swfmt = ((AVHWFramesContext *) link->hw_frames_ctx->data)->sw_format; + // FIXME: this is a hack - we'd like to use the sw_format of + // link->hw_frames_ctx here, but it is not yet available. + // To make this work properly we will need to either reorder + // things so that it is available here or somehow negotiate + // sw_format separately. + swfmt = AV_PIX_FMT_YUV420P; } if (!ff_fmt_is_regular_yuv(swfmt)) { |