OSDN Git Service

cleanup SoftFFmpegVideo
authorMichael Chen <omxcodec@gmail.com>
Sun, 16 Sep 2012 15:59:18 +0000 (23:59 +0800)
committerMichael Chen <omxcodec@gmail.com>
Sun, 16 Sep 2012 15:59:18 +0000 (23:59 +0800)
libstagefright/codecs/ffmpegdec/vdec/SoftFFmpegVideo.cpp
libstagefright/codecs/ffmpegdec/vdec/SoftFFmpegVideo.h

index ab4a4d1..b123df5 100644 (file)
@@ -306,13 +306,12 @@ status_t SoftFFmpegVideo::initDecoder() {
 }
 
 void SoftFFmpegVideo::deInitDecoder() {
-    if (mCodec) {
-        mCodec = NULL;
-    }
-
     if (mCtx) {
-        if (!mCtx->extradata)
+        if (!mCtx->extradata) {
             av_free(mCtx->extradata);
+            mCtx->extradata = NULL;
+            mCtx->extradata_size = 0;
+        }
         avcodec_close(mCtx);
         av_free(mCtx);
         mCtx = NULL;
index efa82f3..f9b308b 100644 (file)
@@ -100,7 +100,6 @@ private:
     };
 
     AVCodecContext *mCtx;
-    AVCodec *mCodec;
     struct SwsContext *mImgConvertCtx;
 
     bool mExtradataReady;