[FFmpeg-cvslog] adpcmenc: refactor some code.

Paul B Mahol git at videolan.org
Sat Jan 28 21:49:16 CET 2012


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Sat Jan 28 19:06:08 2012 +0000| [f870fc2fb9ef1a753d44b8b1d1c267c10581831f] | committer: Michael Niedermayer

adpcmenc: refactor some code.

Signed-off-by: Paul B Mahol <onemda at gmail.com>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f870fc2fb9ef1a753d44b8b1d1c267c10581831f
---

 libavcodec/adpcmenc.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/libavcodec/adpcmenc.c b/libavcodec/adpcmenc.c
index 82cd8b5..d40b8a7 100644
--- a/libavcodec/adpcmenc.c
+++ b/libavcodec/adpcmenc.c
@@ -58,6 +58,8 @@ typedef struct ADPCMEncodeContext {
 
 #define FREEZE_INTERVAL 128
 
+static av_cold int adpcm_encode_close(AVCodecContext *avctx);
+
 static av_cold int adpcm_encode_init(AVCodecContext *avctx)
 {
     ADPCMEncodeContext *s = avctx->priv_data;
@@ -142,10 +144,7 @@ static av_cold int adpcm_encode_init(AVCodecContext *avctx)
 
     return 0;
 error:
-    av_freep(&s->paths);
-    av_freep(&s->node_buf);
-    av_freep(&s->nodep_buf);
-    av_freep(&s->trellis_hash);
+    adpcm_encode_close(avctx);
     return -1;
 }
 



More information about the ffmpeg-cvslog mailing list