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
DataSource: Split off ffmpeg sniffer to a second pass, and only if necessary

ffmpeg's sniffer is intended as a grab-all-that-doesn't-work-elsewhere
extractor. Unfortunately, this causes two issues:

- As written, it requires ffmpeg to whitelist any extractors supported
by stagefright, or else it will blindly override them. This has codebase
sync issues, as shown by the VP9 and WAV accidental overrides
- It imposes an in-depth analysis of _all_ media, even that which we
want to be processed quickly by shipping stagefright plugins (hardware
or not). This is mostly noticeable in network streams and thumbnail
generation.

This patch moves FFmpegExtractor to an independent sniffer queue, and
it only invokes it when the regular MediaExtractor hits 1 of 3 conditions:

1 - The confidence in the identified container type is low
2 - No container is identified at all
3 - A video container was found by other extractors, but only 1 stream
(audio or video) was identified.

Change-Id: Ib96ff4f6bc06223fe0e819a57560d3c872a79ddd
libstagefright: Check for data partitioned clips

- Check for DP clips in ESDS atom of mpeg4 clips
- If the clip is detected to have data partition, return a
  error, so that video decode will fallback to SW decoder

CRs-Fixed: 630669
Change-Id: I21800eabf2a68546b6ad389d18adbb3e9fb08ed7
libstagefright: handle error when B-frame is sent to MPEG4Writer

Without this patch, writing B-frame to MediaMuxer will be blocked and
cannot return a result. This may cause an endless progress bar shown in
gallery when triming or muting some videos.

Change-Id: Ide69ddee04d2419e977b0243557a4eff224631c0
CRs-Fixed: 521005
stagefright: Cancel audioCheck event when setting nativewindow

In html5 playback, setNativeWindow_l() will be called twice
when switching from landscape to portrait mode. If the 2nd
setNativeWindow_l gets the LOCK before proceeding mCheckAudioStatusEvent
posted in the 1st setNativeWindow_l, it will get the infomation
that seeking is completed and won't do seeking in this run.

CRs-fixed: 624469
Change-Id: Ia5c4e373e8a71b907b15b913085600d9481ef982
libstagefright/omx: Fix CallbackDispatcher dereference in callback.

    - findDispatcher can return NULL. Check for NULL.

Change-Id: I07edc427b706dfdeec6a6f90f13d00c8941e77f2
audioflinger: Remove fatal error handling for non offload tracks

- Audio pop is heared on BT during SSR

- On sound card OFFLINE status,pcm track is
  recreated resulting audio pop sound

- Handle OFFLINE status only for offload tracks

Change-Id: I483d4595b61fab4d0be460b9e481ab82f7ab46b5
audio: Fix for failure in CTS MediaRecorderTest cases

 -Issue: MediaRecorder CTS test cases are failing.

 -Running the CTS test "testRecorderRandomAction" at
  beginning sets the huge file size and StageFrightRecorder
  set the 64 bit file offset. In MPEG4 writer
  estimateMoovBoxSize depends on a static const variable
  which uses this file offset info. As the variable to
  calculate estimateMoovBoxSize is static const it remains
  same for next media recording session even if file size
  is small.

 -Fix: Don't use static const variable which is used to
  calculate estimateMoovBoxSize as its value may change
  depending on file offsets.

 CRS-Fixed: 629448

Change-Id: Icdb8658a69667663ba686ae51755f461dd35712c
RTSP: Fix crash issue while repeated pause/resume

While doing repeated pause-resume operation in RTSP streaming,
some times, the accessunit timeout check is being posted when
the streaming paused, and even after receving the EOS.
Due to this check, after the EOS, the number of packets received
will be zero and the session gets Teardown while the
streaming is paused. Upon resume, it leads to check failure and crash.

Changes are done such that the accessunit timeout check will
not be done in pause/seek state.

CRs-Fixed: 636312

Change-Id: I60d09d5394eed59a8e2bbf5556628f1ea26f7807
Merge remote-tracking branch 'cm/cm-11.0' into cm11mod-linaro