stagefright: Fix 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.

Change-Id: I4dc76e7c2a53126c7fbdd3628fe7d339d2e3364e
Update: STE
STE_MULTIMEDIA:STEP1
Revert "STE_MULTIMEDIA:STEP1"

This reverts commit 4940d306cd4ed29c37987420703f695e86fd9aed.
Fixed ifdef and endifs
Test OMX
video: Fix crash during video recording

In pause-resume scenario, MPEG4Writer::start is
called to resume recording, which also resets
start time for writer to -1. If this happens
between two tracks updating the writer start
time, it can end up having the larger of the
start time of the two tracks, which results in
crash later due to assert.

Added change to set mStartTimestampUs to -1 only
when writer is being started, and not resuming from
pause.

CRs-Fixed: 692122
Change-Id: Ia98656acfa3912876d01e92b36c5e06a8c84eb7b
libstagefright: fix issues in AH263Assembler

- if the received rtp packet belongs to the current
  candidate access unit but arrived later, this packet
  still needs to be inserted into this access unit before
  submitting it. Otherwise this incomplete unit would be
  sent to the decoder and cause some potential errors.

- move the functionality for checking the malformed packet
  and calculating the offset of the payload header to one
  function.

Crs-Fixed: 694476
Change-Id: Ie66524ac4b130c443c12bfb007593e5eb4a24019
libstagefright: poke the udp hole twice for future incoming udp packets

- only firing off udp packets once to the source address or the endpoint
  could still be limited in some NAT network environment. As a result,
  client can't receive rtp packets over udp.

- send udp packets to both of the two addresses if they are available.

Change-Id: I7e8a0b36a82bcd85b307c9c15dcfee2bcd7e6030
rtsp: keep some damaged access unit to enhance fault tolerance

Make RTSPSource to accept some damaged access units of H263 to enhance
fault tolerance. Without this patch, damaged access can cause failure of
playback.

Change-Id: I905648f8b30fefa6ec8de18f943ede87641d7300
CRs-Fixed: 687252
HLS: Queue discontinuity only for the first block

If a segment jump happens in HLS, the discontinuity gets
queued for every block read. This leads to continuous decoder
flushes and is observed as a long video freeze.

Changes done to queue the discontinuity only for the first block
after segment jump.

CRs-Fixed: 696452

Change-Id: I79409fe552611fcf3cb6ea9cbc76c8d4f9f5541f
midi audio: allow midi restart even upon stop state

Due to the limitation of EAS_XXX interfaces design, there's no way to
restart midi playback again once last track reaches EOS. To allow this
operation, seek the current track backwards and resume again.

Change-Id: Ib93993eb18e309ac7cb2a305d55ab63f2e86acb9
stagefright: Fix offload fallback for 24bit

Change I398d964a3c5b18f58fcc79376bc29222e796badc disables 24bit
playback on non-offloadable tracks, but tries to read the format
after clear()ing the audio source. Fix the operation order to
do the disable before resetting the source.

Change-Id: Idbbd5e21f9e8fc357a494fabe9028331ebfd2ac4

Conflicts:
	media/libstagefright/AwesomePlayer.cpp