audio: Added lock during closing of direct output

- Lock is missing when direct output is closed in
  closeOutput_nonvirtual. As mDirectAudioTracks is
  being modified in this function, we need a lock
  here to avoid synchronization issues when it is
  accessed from other methods in AudioFlinger
- Fix is protect direct audio track specific block
  with mLock

Change-Id: I88f489c3bbe21ecb198bd836c05b0bfa5826d3c6
CRs-fixed: 611654
MPEG4Extractor: Handle negative composition time offset

Fixes issues when mp4 streams have negative composition
timestamp offsets.

Change-Id: Ide2c0cd6b95da41cb002c7782413cddc86bad3ce
[MovieStudio] Use stride instead of width for preview surfaces.

For some platform specific allocations width is not same as stride.
Fixes this.

Change-Id: I659d40d82246269b212639b92d91c325a3eb87ef
stagefright: Matroska: Handle error for wrong track position

Cue point in matroska is used for fast seeking, and it usally has
video track to seek. If by mistake stream has wrong track position
with different track number than video track, the seek would
result in player crash.

Change-Id: Ifb0845b57f20eb92e36ec9f5bc30f592464d8a8a
libstagefright: free mMoovBoxBuffer

Add free(mMoovBoxBuffer) in MPEG4Writer::release()

Change-Id: Ic396e64e9e238bdc23cb0b02b7aa341d879d2237
libstagefright: Misc Fixes in SF

o mp4writer track codecdataflag fix
o Fallback to software codecs for video playback
o Send seek complete notification for non-seekable
  streams.
o Fix the crash when contents with unsuported
  tracks are pushed on device.
o AAC ADTS header length fix

Change-Id: Id5aa929150815e60e8a99bd3c986949c669d4c35
libstagefright: Handle unsupported codec metaData

Modification done in StagefrightMetadataRetriver
to handle NULL return for meta data if codec is
unsupported by extractor.

Change-Id: I905cec5ee91b098d99e1935437b562d2d9206381