AACExtractor: Added support for APE tag

To support aac audio with APE tag we need parse
this tag. Otherwise AACExtractor stops reading of
audio file.

DR: OMAPS00267689

Change-Id: Ic1c76339cd5d09d41654da2501d19ff078cc5094
Signed-off-by: Volodymyr Makhitko <x0158990@ti.com>
fix a corruption in Vector<> when adding new items

would happen when vectors are copied and new items is
added in both vectors. we didn't duplicate the underlying
storage when adding items in vectors.

Google Bug: 6515797
Google Change-Id: If544c07d96c05821e088d7f2c9b5736f7e306c31

Change-Id: I3e34523bae8fab2fe0417f6a761b798cd6442d4e
Signed-off-by: Jonas Larsson <jonas.larsson@ti.com>
Revert "Properly handle quick switch between Home button and Gallery app"

Reverted due to the following side effects:
We can't bail out of everything right here; this is the actual real new surface
from the window manager, so we at least need to update mSurface so we don't
get stuck holding on to a reference to a reference to an old out-of-date surface.
(see https://android-review.googlesource.com/35040)

This reverts commit 426079fd987cd359bc52acd8b702f81640dac9f0.
Add extra check to updateWindow method of SurfaceView

The change forbids calling of Surface callbacks when Surface become invalid.
This prevents the system from displaying misleading alerts on the cases like shown below.

1. Playing a movie (especially Full HD) by Gallery.
2. Press the Home button.
3. Press the Gallery shortcut on Launcher.
4. Very quickly repeat #2 and #3 several times.

Result: "Sorry, this video cannot be played" alert is shown.

Change-Id: Iaf43e40a1405af2b293118f48e8153844f9e20bc
Signed-off-by: Yuriy Zabroda <yuriy.zabroda@ti.com>
MatroskaExtractor: Workaround for playback for mkv files with lacing.

Most mkv files having 'lacing' in their audio section to save space.
Android did not handle this properly, sending all frames in the block
with the same time code, which causes stuttery playback.

Ported from CyanogenMod. Change-Id: I4dc76e7c2a53126c7fbdd3628fe7d339d2e3364e
Original author: Pawit Pornkitprasan <p.pawit@gmail.com>

Change-Id: Ia70bdbc9d7ffe9bf12f48690683f60a90b697829
Signed-off-by: Illia Ragozin <x0160199@ti.com>
Merge "fix a corruption in Vector<> when adding new items" into p-ics-mr1-release
SF: Added correct handling for malformed mpeg2ts stream

Modified CHECK_EQ/CHECK_GE comparison (that contain exit 1;) to return ERROR_MALFORMED status.
Corrected size for skipping bits for BitReader in parseAdaptationField
Added check for correct processing ERROR_MALFORMED status in MPEG2TSExtractor.
Increased counter for parsed packets (using 10000 we can't get succes for VideoStream detection)
Because there are a lot of broken data in a beginning of stream.

Change-Id: I95397d63cbd4feff0b9903ea920dc336aed0cfd8
Signed-off-by: Sergii Doroshenko <x0163979@ti.com>
MP3Extractor: Calculate duration when XING and VBRI headers are invalid

XING and VBRI headers can contain number of frames value
equal to 0. Number of frames affects the duration value.
As a result, the audio player shows the total  duration
as 0 and track can not seek.

This patch checks if the duration is valid (>0).
If not, the duration is calculated another way.

Change-Id: If3168736aee943c5c9ef2c5268161dd4d4dfc601
Signed-off-by: Volodymyr Makhitko <x0158990@ti.com>
Merge "SF: Added correct handling for malformed mpeg2ts stream" into p-ics-mr1-release
Merge "AACExtractor: Added support for APE tag" into p-ics-mr1-release
Merge changes Iaf43e40a,I98cd3d76 into p-ics-mr1-release

* changes:
  Add extra check to updateWindow method of SurfaceView
  Revert "Properly handle quick switch between Home button and Gallery app"
Merge "MatroskaExtractor: Workaround for playback for mkv files with lacing." into p-ics-mr1-release
Merge branch 'p-ics-mr1-release' of git://git.omapzoom.org/platform/frameworks/base into ics-omapzoom