libstagefright: Add NULL check for mHFRRatio

Commit 12fa017cb "libstagefright: Enable HFR feature for video recording"
is not yet fully implemented. Camera recording will fail because timeScale
is not calculated properly. Add a simple NULL check to fix.

Change-Id: Ieea78efb43645f57615309a91508092433bc34b3
ifdef "stagefright: Enable GraphicBuffer usage to decoder before querying formats"

Breaks video playback on galaxysmtd

I/OMXCodec(  151): [OMX.SEC.AVC.Decoder] AVC profile = 66 (Baseline), level = 30
I/OMXCodec(  151): [OMX.SEC.AVC.Decoder] video dimensions are 640 x 352
W/GraphicBufferAllocator(  148): alloc(640, 352, 19, 00002930, ...) failed -22 (Invalid argument)
E/        (  148): GraphicBufferAlloc::createGraphicBuffer(w=640, h=352) failed (Invalid argument), handle=0x0
E/BufferQueue(  148): [SurfaceView] dequeueBuffer: SurfaceComposer::createGraphicBuffer failed
E/OMXCodec(  151): dequeueBuffer failed: Invalid argument (22)
E/OMXCodec(  151): [OMX.SEC.AVC.Decoder] Allocate Buffer failed - error = -22
E/AwesomePlayer(  151): failed to start video source
E/MediaPlayer( 2023): error (1, -22)
E/MediaPlayer( 2023): Error (1,-22)
D/VideoView( 2023): Error: 1,-22

Change-Id: I9977dcf9fc50936038808ed06bcd85b07efd7bd8
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
libstagefright: bring back mistakenly removed codec quirks

http://review.cyanogenmod.org/#/c/59396/ has mistakenly removed
3 of the codec quirks that are required for certain audio codecs
on OMAP3.

https://github.com/CyanogenMod/android_device_lge_p970/blob/cm-10.1/configs/media_codecs.xml#L28

The implementation of the quirks are still in the upstream code
and they have nothing to do with Legacy HTC.

Change-Id: I2d47bc9cbb451675c5bac6e725c59b367ff458dc
libstagefright: Add NULL check for mHFRRatio

Commit 12fa017cb "libstagefright: Enable HFR feature for video recording"
is not yet fully implemented. Camera recording will fail because timeScale
is not calculated properly. Add a simple NULL check to fix.

Change-Id: Ieea78efb43645f57615309a91508092433bc34b3
ifdef "stagefright: Enable GraphicBuffer usage to decoder before querying formats"

Breaks video playback on galaxysmtd

I/OMXCodec(  151): [OMX.SEC.AVC.Decoder] AVC profile = 66 (Baseline), level = 30
I/OMXCodec(  151): [OMX.SEC.AVC.Decoder] video dimensions are 640 x 352
W/GraphicBufferAllocator(  148): alloc(640, 352, 19, 00002930, ...) failed -22 (Invalid argument)
E/        (  148): GraphicBufferAlloc::createGraphicBuffer(w=640, h=352) failed (Invalid argument), handle=0x0
E/BufferQueue(  148): [SurfaceView] dequeueBuffer: SurfaceComposer::createGraphicBuffer failed
E/OMXCodec(  151): dequeueBuffer failed: Invalid argument (22)
E/OMXCodec(  151): [OMX.SEC.AVC.Decoder] Allocate Buffer failed - error = -22
E/AwesomePlayer(  151): failed to start video source
E/MediaPlayer( 2023): error (1, -22)
E/MediaPlayer( 2023): Error (1,-22)
D/VideoView( 2023): Error: 1,-22

Change-Id: I9977dcf9fc50936038808ed06bcd85b07efd7bd8
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
Merge branch 'cm-11.0' of https://github.com/CyanogenMod/android_frameworks_av into cm-11.0