Miscellaneous fixups for VT contribution update.

fixed misc. spacing and style issues
AAVCAssembler/AHEVCAssembler: fix OOB reads in checkIFrameProvided,
  checkSpsUpdated and dropFramesUntilIFrame
ARTPWriter: fix OOB read in SpsPpsParser, VpsSpsPpsParser and sendVPSSPSPPSIfIFrame
ARTPWriter: use KMP algorithm for VpsSpsPpsParser
ARTPSource/ARTPConnection/RTPSource: rename jbTIme to jbTimeMs

Bug: 165061754
Change-Id: Iceeb3851aed0ba9b1c2c50b1a2378df06faa29d6
diff --git a/media/libmediaplayerservice/nuplayer/NuPlayer.cpp b/media/libmediaplayerservice/nuplayer/NuPlayer.cpp
index 738e42a..47362ef 100644
--- a/media/libmediaplayerservice/nuplayer/NuPlayer.cpp
+++ b/media/libmediaplayerservice/nuplayer/NuPlayer.cpp
@@ -1703,8 +1703,9 @@
 }
 
 void NuPlayer::setTargetBitrate(int bitrate) {
-    if (mSource != NULL)
+    if (mSource != NULL) {
         mSource->setTargetBitrate(bitrate);
+    }
 }
 
 void NuPlayer::onPause() {
diff --git a/media/libmediaplayerservice/nuplayer/NuPlayer.h b/media/libmediaplayerservice/nuplayer/NuPlayer.h
index 2f83224..adb7075 100644
--- a/media/libmediaplayerservice/nuplayer/NuPlayer.h
+++ b/media/libmediaplayerservice/nuplayer/NuPlayer.h
@@ -102,7 +102,7 @@
 
     void updateInternalTimers();
 
-    void setTargetBitrate(int bitrate);
+    void setTargetBitrate(int bitrate /* bps */);
 
 protected:
     virtual ~NuPlayer();
diff --git a/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp b/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
index 857e095..2a50fc2 100644
--- a/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
+++ b/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
@@ -817,7 +817,7 @@
 }
 
 status_t NuPlayerDriver::setParameter(
-        int key, const Parcel& request ) {
+        int key, const Parcel &request ) {
     if (key == KEY_PARAMETER_RTP_ATTRIBUTES) {
         mPlayer->setTargetBitrate(request.readInt32());
         return OK;
diff --git a/media/libmediaplayerservice/nuplayer/RTPSource.cpp b/media/libmediaplayerservice/nuplayer/RTPSource.cpp
index 5388bfd..b1901e8 100644
--- a/media/libmediaplayerservice/nuplayer/RTPSource.cpp
+++ b/media/libmediaplayerservice/nuplayer/RTPSource.cpp
@@ -114,7 +114,8 @@
         // index(i) should be started from 1. 0 is reserved for [root]
         mRTPConn->addStream(sockRtp, sockRtcp, desc, i + 1, notify, false);
         mRTPConn->setSelfID(info->mSelfID);
-        mRTPConn->setJbTime((info->mJbTime <= 3000 && info->mJbTime >= 40) ? info->mJbTime : 300);
+        mRTPConn->setJbTime(
+                (info->mJbTimeMs <= 3000 && info->mJbTimeMs >= 40) ? info->mJbTimeMs : 300);
 
         info->mRTPSocket = sockRtp;
         info->mRTCPSocket = sockRtcp;
@@ -669,7 +670,7 @@
         newTrackInfo.mIsAudio = isAudioKey;
         mTracks.push(newTrackInfo);
         info = &mTracks.editTop();
-        info->mJbTime = 300;
+        info->mJbTimeMs = 300;
     }
 
     if (key == "rtp-param-mime-type") {
@@ -713,7 +714,7 @@
         int64_t networkHandle = atoll(value);
         setSocketNetwork(networkHandle);
     } else if (key == "rtp-param-jitter-buffer-time") {
-        info->mJbTime = atoi(value);
+        info->mJbTimeMs = atoi(value);
     }
 
     return OK;
diff --git a/media/libmediaplayerservice/nuplayer/RTPSource.h b/media/libmediaplayerservice/nuplayer/RTPSource.h
index 5d70142..fb2d3b9 100644
--- a/media/libmediaplayerservice/nuplayer/RTPSource.h
+++ b/media/libmediaplayerservice/nuplayer/RTPSource.h
@@ -129,8 +129,8 @@
         int32_t mTimeScale;
         int32_t mAS;
 
-        /* RTP jitter buffer time in millsecond */
-        uint32_t mJbTime;
+        /* RTP jitter buffer time in milliseconds */
+        uint32_t mJbTimeMs;
         /* Unique ID indicates itself */
         uint32_t mSelfID;
         /* extmap:<value> for CVO will be set to here */