Unified · Split
| @@ -341,34 +341,35 @@ static av_cold void uninit(AVFilterContext *ctx) · 340 unmodified lines | ||
| 341 | 341 | static int query_formats(AVFilterContext *ctx) |
| 342 | 342 | { |
| 343 | 343 | AVFilterFormats *formats; |
| 344 | + const AVPixFmtDescriptor *desc; | |
| 344 | 345 | enum AVPixelFormat pix_fmt; |
| 345 | 346 | int ret; |
| 346 | 347 | |
| 347 | − const AVPixFmtDescriptor *desc = NULL; | |
| 348 | − formats = NULL; | |
| 349 | − while ((desc = av_pix_fmt_desc_next(desc))) { | |
| 350 | − pix_fmt = av_pix_fmt_desc_get_id(desc); | |
| 351 | − if ((sws_isSupportedInput(pix_fmt) || | |
| 352 | − sws_isSupportedEndiannessConversion(pix_fmt)) | |
| 353 | − && (ret = ff_add_format(&formats, pix_fmt)) < 0) { | |
| 354 | − return ret; | |
| 355 | − } | |
| 356 | − } | |
| 357 | − if ((ret = ff_formats_ref(formats, &ctx->inputs[0]->outcfg.formats)) < 0) | |
| 348 | + desc = NULL; | |
| 349 | + formats = NULL; | |
| 350 | + while ((desc = av_pix_fmt_desc_next(desc))) { | |
| 351 | + pix_fmt = av_pix_fmt_desc_get_id(desc); | |
| 352 | + if ((sws_isSupportedInput(pix_fmt) || | |
| 353 | + sws_isSupportedEndiannessConversion(pix_fmt)) | |
| 354 | + && (ret = ff_add_format(&formats, pix_fmt)) < 0) { | |
| 358 | 355 | return ret; |
| 359 | − | |
| 360 | − desc = NULL; | |
| 361 | − formats = NULL; | |
| 362 | − while ((desc = av_pix_fmt_desc_next(desc))) { | |
| 363 | − pix_fmt = av_pix_fmt_desc_get_id(desc); | |
| 364 | − if ((sws_isSupportedOutput(pix_fmt) || pix_fmt == AV_PIX_FMT_PAL8 || | |
| 365 | − sws_isSupportedEndiannessConversion(pix_fmt)) | |
| 366 | − && (ret = ff_add_format(&formats, pix_fmt)) < 0) { | |
| 367 | − return ret; | |
| 368 | − } | |
| 369 | 356 | } |
| 370 | − if ((ret = ff_formats_ref(formats, &ctx->outputs[0]->incfg.formats)) < 0) | |
| 357 | + } | |
| 358 | + if ((ret = ff_formats_ref(formats, &ctx->inputs[0]->outcfg.formats)) < 0) | |
| 359 | + return ret; | |
| 360 | + | |
| 361 | + desc = NULL; | |
| 362 | + formats = NULL; | |
| 363 | + while ((desc = av_pix_fmt_desc_next(desc))) { | |
| 364 | + pix_fmt = av_pix_fmt_desc_get_id(desc); | |
| 365 | + if ((sws_isSupportedOutput(pix_fmt) || pix_fmt == AV_PIX_FMT_PAL8 || | |
| 366 | + sws_isSupportedEndiannessConversion(pix_fmt)) | |
| 367 | + && (ret = ff_add_format(&formats, pix_fmt)) < 0) { | |
| 371 | 368 | return ret; |
| 369 | + } | |
| 370 | + } | |
| 371 | + if ((ret = ff_formats_ref(formats, &ctx->outputs[0]->incfg.formats)) < 0) | |
| 372 | + return ret; | |
| 372 | 373 | |
| 373 | 374 | return 0; |
| 374 | 375 | } |