Update mLowDelay value when startVA am: f75cf2c237
am: f0ce477854

* commit 'f0ce47785460c71e30efd546b9317d0b4bb62deb':
  Update mLowDelay value when startVA

Change-Id: Id59c2ab420146195f376149a90090d04c2c8770c
diff --git a/videodecoder/VideoDecoderAVC.cpp b/videodecoder/VideoDecoderAVC.cpp
index ca4b123..077710c 100644
--- a/videodecoder/VideoDecoderAVC.cpp
+++ b/videodecoder/VideoDecoderAVC.cpp
@@ -681,6 +681,15 @@
     //Use high profile for all kinds of H.264 profiles (baseline, main and high) except for constrained baseline
     VAProfile vaProfile = VAProfileH264High;
 
+    if (mConfigBuffer.flag & WANT_ADAPTIVE_PLAYBACK) {
+        // When Adaptive playback is enabled, turn off low delay mode.
+        // Otherwise there may be a 240ms stuttering if the output mode is changed from LowDelay to Delay.
+        enableLowDelayMode(false);
+    } else {
+        // for baseline profile or constrained high profile, enable low delay mode automatically
+        enableLowDelayMode((data->codec_data->profile_idc == 66) || (data->codec_data->profile_idc == 100 && data->codec_data->constraint_set4_flag == 1 && data->codec_data->constraint_set5_flag == 1));
+    }
+
     // TODO: determine when to use VAProfileH264ConstrainedBaseline, set only if we are told to do so
     if ((data->codec_data->profile_idc == 66 || data->codec_data->constraint_set0_flag == 1) &&
         data->codec_data->constraint_set1_flag == 1) {
@@ -716,15 +725,6 @@
     ITRACE("updateFormatInfo: current size: %d x %d, new size: %d x %d",
         mVideoFormatInfo.width, mVideoFormatInfo.height, width, height);
 
-    if (mConfigBuffer.flag & WANT_ADAPTIVE_PLAYBACK) {
-        // When Adaptive playback is enabled, turn off low delay mode.
-        // Otherwise there may be a 240ms stuttering if the output mode is changed from LowDelay to Delay.
-        enableLowDelayMode(false);
-    } else {
-        // for baseline profile or constrained high profile, enable low delay mode automatically
-        enableLowDelayMode((data->codec_data->profile_idc == 66) || (data->codec_data->profile_idc == 100 && data->codec_data->constraint_set4_flag == 1 && data->codec_data->constraint_set5_flag == 1));
-    }
-
     if ((mConfigBuffer.flag & USE_NATIVE_GRAPHIC_BUFFER) && mStoreMetaData) {
         pthread_mutex_lock(&mFormatLock);
     }