Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 5188aa6f authored by Apurupa Pattapu's avatar Apurupa Pattapu Committed by Steve Kondik
Browse files

stagefright: httplive: Fix switching for HLS live use-cases

Playlists can periodically update during HLS live streaming, and
the first sequence number can change accordingly. When switching,
this leads to a mismatch in first sequence numbers that causes
selection of the wrong segment, as the passed segmentStartTimeUs
value is relative to the old first sequence number.
For a/v fetchers, pass the previous a/v fetcher's sequence number to
each new fetcher to enforce continuity of a/v streams.

Change-Id: I26d8118dbcb7300571a5b3fb5d0808c5a0c08aa6

httplive: Dont resume old fetchers if switching down

- When bandwidth drops, resuming an old high-bitrate fetcher
  can cause freezes in playback. To avoid this, stop the
  fetcher without checking for any timestamp gaps.

CRs-Fixed: 771954
Change-Id: I690f50322a64e0b2c493062388c4b490b71db146

stagefright: HLS: Remove LiveDataSource

Remove LiveDataSource as it is no longer used.

Change-Id: I07d9b09358dcdd2cb9e54fb6351e1c9027ce8a0d

httplive: Do not delay fetcher when resuming

During a switch resumeUntil is called on old fetcher so
that it continues to download until the timestamp gap between
old and new fetchers is filled. If this is posted with a delay
new fetcher is scheduled first and it continues to download
second segment increasing the switch latency.To avoid this
resume fetcher download immediately.

Change-Id: Ibdde95e016d83286dceed3f001b9a1d8b56b0367

stagefright: HLS: Increase granularity of segment download

Current HLS logic requires downloading an entire segment before
bandwidth estimation or any other scheduled message can be
processed which hurts the effectiveness of the downswitch monitor.
If a large clip is being downloaded and the bandwidth drops
suddenly, playback can hang until download of the large clip
completes regardless of the downswitch monitor's status.

Expand onDownloadNext into a series of onDownloadBlock messages
to allow increased potential for message interleaving, but ensure
that segment downloads themselves are not interleaved as
LiveSession reuses a single http connection.

CRs-Fixed: 759591 771954
Change-Id: I6a9ba27e22cc4e04419ce0128ad0193edac9c42b

httplive: Start playback at the actual bandwidth variant

Download ts segment from the first playlist variant to
evaluate the actual bandwidth and start the playback
with actual b/w variant.

Change-Id: Iaf86eb0124c9511a6a2e3580a91f666e711e54b3

httplive: the triggers to switch up and down should be asymmetrical

- change the usage rate of the real bandwidth from 80% to 90% except
  the first time

- in up switch case, only when the real bandwidth is 30% above the
  target bandwidth, the corresponding index would be changed to the
  target one. Otherwise, the corresponding index should move to one
  lower level of the target index.

CRs-Fixed: 810277
Change-Id: I35e871e8d7702274d7ef880b6744b2ab763d6967

stagefright: httplive: Enable dumping of fetched segments

If SAVE_BACKUPS is enabled, create a numbered backup file for each
new fetchFile() connection and archive all received bytes within
/data/misc/media. Increase the number for each new connection
within a playback session to aid in debugging switching use-cases.

Also immediately flush all data after each readAt() to allow
debugging crashes/asserts without loss of retrieved data.

CRs-Fixed: 771954
Change-Id: I38cb9653ffff8e8c6253a8caa0a7ee4a0bc7816f

httplive: avoid zero byte read request

- In LiveSession, check whether maxBytesToRead is zero, if yes
  ignore it because zero byte read request is meaningless.

- In PlaylistFetcher, check whether the read bytes is less than
  the requested block size, if yes, finish fetching the current
  segment file because it means fetching file already meets EOS.

Change-Id: I150d4b147090dbd48d804ebd96ea909e5b6fdbcb

httplive: Print name of segment being downloaded

Add change to print name of segment being downloaded
CRs-Fixed: 787126

Change-Id: Ice204b9bb6778ba16962610df5cd4e8b18576fd9
(cherry picked from commit eb822627e1219686860c07ea0ca4509125dc8174)

HLS: Fix issues in hls

Because of the merge conflicts while
porting L-Mr1, live session is accessing
the invalid buffer. Corrected the same.

CRs-Fixed: 807394
Change-Id: I60ff90ae7ef9ad4b6bcf0956e022289fb552d766
parent 7dadc6a7
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment