private final void handleStop() { if (DEBUG) Log.v(TAG, "handleStop:"); synchronized (mVideoTask) { internal_stop_video(); mVideoTrackIndex = -1; } if (mVideoMediaCodec != null) { mVideoMediaCodec.stop(); mVideoMediaCodec.release(); mVideoMediaCodec = null; } if (mVideoMediaExtractor != null) { mVideoMediaExtractor.release(); mVideoMediaExtractor = null; } mVideoBufferInfo = null; mVideoInputBuffers = mVideoOutputBuffers = null; if (mMetadata != null) { mMetadata.release(); mMetadata = null; } synchronized (mSync) { mVideoOutputDone = mVideoInputDone = true; mState = STATE_STOP; } mCallback.onFinished(); }