Commit a81945cc authored by benoit's avatar benoit

add an AVClass pointer in SwsContext context


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@9434 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent cdda9ceb
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
#define LINE_BUF_HEIGHT (NB_TAPS * 4) #define LINE_BUF_HEIGHT (NB_TAPS * 4)
struct SwsContext { struct SwsContext {
AVClass *av_class;
struct ImgReSampleContext *resampling_ctx; struct ImgReSampleContext *resampling_ctx;
enum PixelFormat src_pix_fmt, dst_pix_fmt; enum PixelFormat src_pix_fmt, dst_pix_fmt;
}; };
...@@ -642,7 +643,8 @@ struct SwsContext *sws_getContext(int srcW, int srcH, int srcFormat, ...@@ -642,7 +643,8 @@ struct SwsContext *sws_getContext(int srcW, int srcH, int srcFormat,
struct SwsContext *ctx; struct SwsContext *ctx;
ctx = av_malloc(sizeof(struct SwsContext)); ctx = av_malloc(sizeof(struct SwsContext));
if (ctx == NULL) { ctx->av_class = av_mallocz(sizeof(AVClass));
if (!ctx || !ctx->av_class) {
av_log(NULL, AV_LOG_ERROR, "Cannot allocate a resampling context!\n"); av_log(NULL, AV_LOG_ERROR, "Cannot allocate a resampling context!\n");
return NULL; return NULL;
...@@ -676,6 +678,7 @@ void sws_freeContext(struct SwsContext *ctx) ...@@ -676,6 +678,7 @@ void sws_freeContext(struct SwsContext *ctx)
} else { } else {
av_free(ctx->resampling_ctx); av_free(ctx->resampling_ctx);
} }
av_free(ctx->av_class);
av_free(ctx); av_free(ctx);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment