aboutsummaryrefslogtreecommitdiffstats
path: root/libswscale/utils.c
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.dev>2024-10-09 23:15:48 +0200
committerNiklas Haas <git@haasn.dev>2024-10-23 23:04:04 +0200
commit87baf9ab2c2465034a90a59308fab34e2801f2b3 (patch)
tree27c72ad41551d0aea21ad80a2f2964143e7c19f6 /libswscale/utils.c
parent3bf12beae9eea20b4b6270a9228c877223e81157 (diff)
downloadffmpeg-87baf9ab2c2465034a90a59308fab34e2801f2b3.tar.gz
swscale: add sws_free_context()
Merely a convenience wrapper around sws_freeContext(). The name change is for parity with the other sws_* functions. Sponsored-by: Sovereign Tech Fund Signed-off-by: Niklas Haas <git@haasn.dev>
Diffstat (limited to 'libswscale/utils.c')
-rw-r--r--libswscale/utils.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/libswscale/utils.c b/libswscale/utils.c
index 5980597776..0c9e8d58fc 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -2515,6 +2515,16 @@ void sws_freeContext(SwsContext *c)
av_free(c);
}
+void sws_free_context(SwsContext **pctx)
+{
+ SwsContext *ctx = *pctx;
+ if (!ctx)
+ return;
+
+ sws_freeContext(ctx);
+ *pctx = NULL;
+}
+
SwsContext *sws_getCachedContext(SwsContext *context, int srcW,
int srcH, enum AVPixelFormat srcFormat,
int dstW, int dstH,