FLAC coded file does not play (single metadata block files)

FLAC files which has the last metadata block flag set in
STREAMINFO were not playing. Sniff of FLAC is modified to
accomodate this set flag.

Change-Id: Ia40e3753e8c40e82d5545d52a88ed239eed9c416
Author: Gurudatta Bhakte <gurudattax.bhakte@intel.com>
Signed-off-by: Gurudatta Bhakte <gurudattax.bhakte@intel.com>
Singed-off-by: Shuo Gao <shuo.gao@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 32421
Short noise occurs when seeking FLAC music contents.

The pcm data returned by the FLAC Decoder after seek operation is
causing noise. The pcm data/buffer is omitted from being sent back
to AudioPlayer.

Change-Id: I0aff170b0495c1559cdf740fa4174225f6e460c5
Author: Gurudatta Bhakte <gurudattax.bhakte@intel.com>
Signed-off-by: Gurudatta Bhakte <gurudattax.bhakte@intel.com>
Singed-off-by: Shuo Gao <shuo.gao@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 25416
Add 100us scheduling interval between consecutive video events

Add 100us scheduling interval between consecutive video events so that
any attempts to cancel future video events has opportunity to be invoked
during the 100us time slot. For BZ7871, after adding this patch, the
suspend() methods could be invoked successfully after power button
is pressed.

Change-Id: I5f9fce75cc4a972c0c2dc4d739d946de4fff03d6
Author: Weian Chen <weian.chen@intel.com>
Signed-off-by: Dan Liang <dan.liang@intel.com>
Signed-off-by: Weian Chen <weian.chen@intel.com>
Signed-off-by: Shuo Gao <shuo.gao@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 48604, 7871, 18523
Fix crash when seek after disconnect from server in RTSPSource

  if seek after log 'stream ended? abort' is printed out,
  client already disconnect from server.
  it shall crash at performSeek as mHandler is cleared in onDisconnect.

  this patch redefine RTSPSource LOG_TAG, avoid being overrided by MyHandler.

Change-Id: I78e6c1bb063666b068a6974920343631aa2c72e1
Signed-off-by: Yajun Zeng <beanz@marvell.com>
libstagefright: release the socket in ARTPConnection

RTP packet polling and Myhandle is in different thread, after close the
socket in myhandle, there may occur assertion failure in ARTPConnection
if onRemove function is not called, release the socket after remove RTP
Connection

Change-Id: I3f1f6461a22ad616a8e80f2bb993b753414b8c52
Author: Yi Wang <yi.a.wang@intel.com>
Signed-off-by: Yi Wang <yi.a.wang@intel.com>
Signed-off-by: Shuo Gao <shuo.gao@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 49305, 22477, 18533

Conflicts:
	media/libstagefright/rtsp/MyHandler.h
libstagefright: adjust audio seek for mkv container

The original seeking method can only deal with the case
that the SimpleBlocks of both audio and video are packed
in the head of a cluster. The testing clip is quite
special, as the key frame for video is located at the end
of a cluster, at 10000ms, while the first SimpleBlock of
audio in this cluster starts at 5013ms. So video is stopped
untill audio catches up.

After modification, audio will advance to the nearest point
as video has seeked to.

Change-Id: Ic03abea1ebb8ef630ae9000dd904c2ce3986d5af
Author: Dan Liang <dan.liang@intel.com>
Signed-off-by: Dan Liang <dan.liang@intel.com>
Signed-off-by: Shuo Gao <shuo.gao@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 57484
RTSP Streaming: Handle truncated url:s in RTP-Info in PLAY response

Allow the url in the RTP-Info field in the PLAY response to be a
truncated variant of the complete SETUP url.
For example: "url=trackID=1"

Change-Id: I7ee589d4a31f1d54609e5946e50a91a620760aa5

Conflicts:
	media/libstagefright/rtsp/MyHandler.h
Fixed data offset at parsing IPMP Descriptors

MPEG4Extractor::parseDrmSINF() miscalculated data offset in parsing
IPMP Descriptors. This commit makes it to take in 2 bytes which is
the size of IPMPS_Type field.

Change-Id: I42cbb6793af9d9b2f14dbfdd7a616096002793f9
Using sizeof on array given as function argument

Change-Id: Ieb4c23a63bf0faf8f23985daa38cdf1e12caeef6
Signed-off-by: You Kim <you.kim72@gmail.com>
AudioPolicyService: malloc/delete pair

Change-Id: I75cd44ac0caccda9148faaa052c9e7a0c06d46d1
Signed-off-by: You Kim <you.kim72@gmail.com>
Audio: Irregular timing shown at the last few seconds of the local playback.

Trying to get the "mPositionTimeMediaUs" when buffer size is zero resulted in unexpected time value.
Fix: Check to get the mediatime in fillbuffer only when there is non zero buffer, (When the input buffer is available).

Change-Id: Ifa12e761e3585a7d377d4aba2a2eb5674bcacf64
Author: Gurudatta Bhakte <gurudattax.bhakte@intel.com>
Signed-off-by: Gurudatta Bhakte <gurudattax.bhakte@intel.com>
Signed-off-by: Shuo Gao <shuo.gao@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 24538
Detect empty playlists for HLS

Detect if an HLS playlist is empty and report an error instead
of crashing.

Change-Id: Ic8c475bcaca35ae0d0b838ee3fef6d0d37f7c877
Abort RTSP time update if abort has been called

If the RTSP session is aborted and then received 'accu' with
time update, mTracks has been cleared, so will use NULL pointer
track in onTimeUpdate. This fix will check the track is valid
earlier before proceeding time update.

Change-Id: Ibffba17b0c8a70947981c523ffe9210cebd6b98e