[FFmpeg-cvslog] r21105 - trunk/libavfilter/vf_scale.c
stefano
subversion
Sat Jan 9 00:48:33 CET 2010
Author: stefano
Date: Sat Jan 9 00:48:32 2010
New Revision: 21105
Log:
Make the scale filter set in the input and output links only the
respective pixel formats effectively supported by libswscale.
Modified:
trunk/libavfilter/vf_scale.c
Modified: trunk/libavfilter/vf_scale.c
==============================================================================
--- trunk/libavfilter/vf_scale.c Fri Jan 8 20:59:51 2010 (r21104)
+++ trunk/libavfilter/vf_scale.c Sat Jan 9 00:48:32 2010 (r21105)
@@ -69,13 +69,27 @@ static av_cold void uninit(AVFilterConte
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);
}
More information about the ffmpeg-cvslog
mailing list