Review rework for issue 3385068 : Play gets out of sync

Change-Id: I7f7435bd898a72302500cdc15874e469922cbebe
diff --git a/media/java/android/media/videoeditor/MediaArtistNativeHelper.java b/media/java/android/media/videoeditor/MediaArtistNativeHelper.java
index f078cf6..f10f5e8 100755
--- a/media/java/android/media/videoeditor/MediaArtistNativeHelper.java
+++ b/media/java/android/media/videoeditor/MediaArtistNativeHelper.java
@@ -2867,11 +2867,8 @@
             mClipProperties.clipProperties = new Properties[mTotalClips];
 
             /** record the call back progress listner */
-            if (listener != null)
-            {
-                mMediaProcessingProgressListener = listener;
-                mProgressToApp = 0;
-            }
+            mMediaProcessingProgressListener = listener;
+            mProgressToApp = 0;
 
             if (mediaItemsList.size() > 0) {
                 for (int i = 0; i < mediaItemsList.size(); i++) {
@@ -3022,9 +3019,8 @@
     public void doPreview(Surface surface, long fromMs, long toMs, boolean loop,
             int callbackAfterFrameCount, PreviewProgressListener listener) {
         mPreviewProgress = fromMs;
-        if (listener != null) {
-            mPreviewProgressListener = listener;
-        }
+        mPreviewProgressListener = listener;
+
         if (!mInvalidatePreviewArray) {
             try {
                 /** Modify the image files names to rgb image files. */
@@ -3555,9 +3551,9 @@
         int outBitrate = 0;
         mExportFilename = filePath;
         previewStoryBoard(mediaItemsList, mediaTransitionList, mediaBGMList,null);
-        if (listener != null) {
-            mExportProgressListener = listener;
-        }
+
+        mExportProgressListener = listener;
+
         mProgressToApp = 0;
 
         switch (bitrate) {
@@ -3682,9 +3678,9 @@
         int outBitrate = 0;
         mExportFilename = filePath;
         previewStoryBoard(mediaItemsList, mediaTransitionList, mediaBGMList,null);
-        if (listener != null) {
-            mExportProgressListener = listener;
-        }
+
+        mExportProgressListener = listener;
+
         mProgressToApp = 0;
 
         switch (bitrate) {
@@ -3977,9 +3973,8 @@
             ExtractAudioWaveformProgressListener listener, boolean isVideo) {
         String tempPCMFileName;
 
-        if (listener != null) {
-            mExtractAudioWaveformProgressListener = listener;
-        }
+        mExtractAudioWaveformProgressListener = listener;
+
         /**
          * in case of Video , first call will generate the PCM file to make the
          * audio graph