diff options
author | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2010-07-11 11:35:00 +0400 |
---|---|---|
committer | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2010-07-11 11:35:00 +0400 |
commit | e1d7c8831cf6dddddb8e151a673e89016d7b10db (patch) | |
tree | 49852530bc45ea8d3acd66d8850c33c602caf93c /libavcodec/utils.c | |
parent | c426562cbfbe24f3b37ba98b80c128dbcc1b7cc8 (diff) |
Add avsubtitle_free function.
Originally committed as revision 24185 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r-- | libavcodec/utils.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c index c3d701c74f..ced6b64c29 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -689,6 +689,26 @@ int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub, return ret; } +void avsubtitle_free(AVSubtitle *sub) +{ + int i; + + for (i = 0; i < sub->num_rects; i++) + { + av_freep(sub->rects[i]->pict.data[0]); + av_freep(sub->rects[i]->pict.data[1]); + av_freep(sub->rects[i]->pict.data[2]); + av_freep(sub->rects[i]->pict.data[3]); + av_freep(sub->rects[i]->text); + av_freep(sub->rects[i]->ass); + av_freep(sub->rects[i]); + } + + av_freep(sub->rects); + + memset(sub, 0, sizeof(AVSubtitle)); +} + av_cold int avcodec_close(AVCodecContext *avctx) { /* If there is a user-supplied mutex locking routine, call it. */ |