[FFmpeg-devel] [PATCH 3/3] Set default values for the scale context in sws_alloc_context().

Stefano Sabatini stefano.sabatini-lala
Wed Sep 29 20:41:20 CEST 2010


---
 utils.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/utils.c b/utils.c
index ad8895b..0282f62 100644
--- a/utils.c
+++ b/utils.c
@@ -44,6 +44,7 @@
 #include "libavutil/avutil.h"
 #include "libavutil/bswap.h"
 #include "libavutil/pixdesc.h"
+#include "libavutil/opt.h"
 
 unsigned swscale_version(void)
 {
@@ -746,6 +747,7 @@ SwsContext *sws_alloc_context(void)
     SwsContext *c= av_mallocz(sizeof(SwsContext));
 
     c->av_class = &sws_context_class;
+    av_opt_set_defaults(c);
 
     return c;
 }
@@ -1154,9 +1156,6 @@ SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat,
     if (param) {
         c->param[0] = param[0];
         c->param[1] = param[1];
-    } else {
-        c->param[0] =
-        c->param[1] = SWS_PARAM_DEFAULT;
     }
     sws_setColorspaceDetails(c, ff_yuv2rgb_coeffs[SWS_CS_DEFAULT], c->srcRange, ff_yuv2rgb_coeffs[SWS_CS_DEFAULT] /* FIXME*/, c->dstRange, 0, 1<<16, 1<<16);
 
-- 
1.7.1




More information about the ffmpeg-devel mailing list