audio:Avoid VideoLagUpdate if there is no AudioPlayer

-When AudioTrack is failed to initialized, mAudioPlayer
 is deleted in onVideoEvent but onVideoLagUpdate() is still
 trying to access mAudioPlayer which is leading to a crash.
 The function onVideoLagUpdate() is used to notify if video
 is lagging behind audio. So this function is no longer
 valid if AudioPlayer is deleted.

-Fix is to add a check for AudioPlayer in onVideoLagUpdate,
 which will avoid onVideoLagUpdate() if there is no
 AudioPlayer

Change-Id: Ie8dbfc1995a3da88a4a435ec2de86b1c22a07c65
CRs-Fixed: 647200
NuPlayer: Fix ANR while resetting RTSP playback

- When network is poor, the response of RTSP teardown won't be received
  in time, so ANR will happen.
- With this patch, a teardown message will be sent when timeout expires,
  in order to avoid ANR.

Change-Id: I3f9efd9fefa66104ad452559ced5ff5218d73a66
CRs-Fixed: 650866
libstagefright: Fix to free buffers in error scenarios

- MediaBuffer objects are not freed if component transitions from
  IDLE->EXECUTING or EXECUTING->LOADED fails (or if the
  OMX_CmdComplete messages are dropped due to an earlier error)
  Additionally with native buffers, the corresponding
  ANativeWindowBuffers are not cancelled back in the above scenarios.

CRs-Fixed: 640236

Change-Id: I62bdcde5d52ee65cba457a9b5e938e0390d8d9b4
audio: Fixed condition to load AAC HW Encoder

- UseQCHWAACEncoder checks if the bitrate passed by the
  client is in the supported bit rate range of the
  AAC Hw Encoder. It is wrongly compared with the
  sample rate passed by the client instead of bitrate
  This is leading to loading of Hw Encoder even when
  unsupported bitrate is passed

- Fix is to correct the condition to compare with bitrate
  instead of sample rate

Change-Id: I88f4cbcf476dab8bd2bd44860b75ee3ffc3a5bb9
CRs-fixed: 659716