possibly causing a lossy conversion elsewhere in the graph.
To avoid that, pretend that there are no common formats to force the
insertion of a conversion filter. */
- if (type == AVMEDIA_TYPE_VIDEO)
possibly causing a lossy conversion elsewhere in the graph.
To avoid that, pretend that there are no common formats to force the
insertion of a conversion filter. */
- if (type == AVMEDIA_TYPE_VIDEO)
-+ for (i = 0; i < a->nb_formats; i++) {
-+ const AVPixFmtDescriptor *adesc = av_pix_fmt_desc_get(a->formats[i]);
+ for (i = 0; i < a->nb_formats; i++) {
+ const AVPixFmtDescriptor *const adesc = av_pix_fmt_desc_get(a->formats[i]);
const AVPixFmtDescriptor *bdesc = av_pix_fmt_desc_get(b->formats[j]);
+ if( !bdesc ) continue;
alpha2 |= adesc->flags & bdesc->flags & AV_PIX_FMT_FLAG_ALPHA;
chroma2|= adesc->nb_components > 1 && bdesc->nb_components > 1;
if (a->formats[i] == b->formats[j]) {
const AVPixFmtDescriptor *bdesc = av_pix_fmt_desc_get(b->formats[j]);
+ if( !bdesc ) continue;
alpha2 |= adesc->flags & bdesc->flags & AV_PIX_FMT_FLAG_ALPHA;
chroma2|= adesc->nb_components > 1 && bdesc->nb_components > 1;
if (a->formats[i] == b->formats[j]) {