merge in jb-mr0-release history after reset to jb-dev
libstagefright: Fix for clips getting skipped during playback

-mLpaInProgress gets set to true for non-lpa mp3 and aac clips and
is never reset as LPA destructor is never called. Due to this, next
clips which require hardware decoder get skipped. Same scenario is
observed if a lpa clip is skipped.
-Fix this by making mLpaInProgress true only for LPA clips. Also
reset this variable always to ensure no issue is seen if lpa
clip is skipped.

Change-Id: I54c37d8c8ca7b48c67d7b173399f88c8d3b4e059
CRs-Fixed: 401725
libmedia: Fix for LPA audio loss issue

-LPA playback has no audio if next clip is selected and immediately
paused.
-DirectTrack write is called after pause that makes mActive true.
Due to this, start to DirectTrack fails to reach below layers as
mActive is true. Hence no audio is heard.
-Remove mActive being made true in DirectTrack write call.

Change-Id: I2faf5a41a91f077fce9cfd8e773ceebb69e55bbb
libaudioflinger: fix crash in LPA effects due to multiple tracks

- In gapless playback, the next track is created before the previous track
  is cleared. During this time, the effect chain is associated with the
  previous track
- If the next track is LPA, that track is not able to acquire the effect chain since
  the effect chain is associated with the previous track. This results in a failure
  in the creation of LPA track and hence a crash.

Change-Id: I8e3756f61fdb4401757317a92991888a369a4a6a
(cherry picked from commit d342a699a580d8ffe94416c59e1dc2c5321b8c4e)
Merge branch 'jb-mr0-release' of https://android.googlesource.com/platform/frameworks/av into aosp-merge
libstagefright: Add support for the 720P OMAP3 encoders

Bring back some more OMAP code that was removed by Google in JB,
and a couple of omapzoom patches.
This may stop being necessary if TI publishes JB-specific OMAP3
code, but as long as we're using the ICS domx, these need to
be here
Change-Id: Ia29f8c9f9ed769ba07b09c07260486f6502841d6
Fix typo in codecHasQuirk

This patch fixes a typo in the Quirk name
"requies-loaded-to-idle-after-allocation"
should be
"requires-loaded-to-idle-after-allocation"
camera: add define for ISO settings

Change-Id: I8716a260ad552d3684197237c2055dce129e461e
libstagefright: avoid audio source to start before audio player after seek

If audio source is started before audio player during seek, audio source
will start allowing the audio data from the beginning (as seekTime for
Audio is maintained in AudioPlayer and is set once we start the audio player)
Once AudioPlayer is started, it sets the seektime and the data starts from seektime.

This change avoids audio source to start before starting audio player.

CRs-Fixed: 402140

Change-Id: Iad42a5235766478740966788cb9e1dd853104b57
libstagefright: reset flag to allow buffering

When buffering is 100% or eos is reached, buffering flag
is set.If the playback is seeked back to some location
after EOS, no buffering happen. Without buffering, user experience
is bad in poor network condition.
This also handle file having header at the end. While reading
header EOS get set and buffering is prevented.

Reset the flag to allow buffering during above use cases.

CRs-Fixed: 409247

Change-Id: I60bfa4fcd0228bbb02eccb588087e9833fdf1661
Revert "libstagefright: Fix for clips getting skipped during playback"

This reverts commit 11df26c1b691df81258754af8e6f34b521c009f9.

Revert "libstagefright: LPA playback fails when non-LPA clip is next clip"

This reverts commit 966e97c11cc141891fe39787cf059a7a3b57a52b.

Change-Id: I1abed5f0560bef84ab95cc4492a857fb65100dbf
audio: Fix mismerges

 * Clean up a bad merge due to inconsistencies in the CAF branches.
 * Also fix build with debugging enabled.

Change-Id: I8a2a0d4aff5faae71fd648c67bc925d376d3a8a0
audioflinger: Properly initialize bytesToWrite for LPA effects

 * Fix the crash when applying effects on the first audio buffer due to
   uninitialized variable.

Change-Id: I371880bb7392b276ca8fa7af16cdd2b692c63c40