summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefano Sabatini <stefano.sabatini-lala@poste.it>2010-01-08 23:48:32 +0000
committerStefano Sabatini <stefano.sabatini-lala@poste.it>2010-01-08 23:48:32 +0000
commit27d8f6b660d7d72520551b8f3ecb2b2725593f70 (patch)
treec40ee6f68c0c291f837b52a62b6808ff5f7a9d64
parenta7ac9c2f62497451d3f88ae5561e94e22d014d3c (diff)
Make the scale filter set in the input and output links only the
respective pixel formats effectively supported by libswscale. Originally committed as revision 21105 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavfilter/vf_scale.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/libavfilter/vf_scale.c b/libavfilter/vf_scale.c
index 381d572ff9..6ccdde26c0 100644
--- a/libavfilter/vf_scale.c
+++ b/libavfilter/vf_scale.c
@@ -69,13 +69,27 @@ static av_cold void uninit(AVFilterContext *ctx)
static int query_formats(AVFilterContext *ctx)
{
AVFilterFormats *formats;
+ enum PixelFormat pix_fmt;
+ int ret;
if (ctx->inputs[0]) {
- formats = avfilter_all_colorspaces();
+ formats = NULL;
+ for (pix_fmt = 0; pix_fmt < PIX_FMT_NB; pix_fmt++)
+ if ( sws_isSupportedInput(pix_fmt)
+ && (ret = avfilter_add_colorspace(&formats, pix_fmt)) < 0) {
+ avfilter_formats_unref(&formats);
+ return ret;
+ }
avfilter_formats_ref(formats, &ctx->inputs[0]->out_formats);
}
if (ctx->outputs[0]) {
- formats = avfilter_all_colorspaces();
+ formats = NULL;
+ for (pix_fmt = 0; pix_fmt < PIX_FMT_NB; pix_fmt++)
+ if ( sws_isSupportedOutput(pix_fmt)
+ && (ret = avfilter_add_colorspace(&formats, pix_fmt)) < 0) {
+ avfilter_formats_unref(&formats);
+ return ret;
+ }
avfilter_formats_ref(formats, &ctx->outputs[0]->in_formats);
}