4592 Commits

Author SHA1 Message Date
Andrew Lewis
6799097930
Fix decoder fallback for E-AC3 JOC to E-AC3
Issue: #6073
2019-06-21 11:50:12 +01:00
Oliver Woodman
c8955ed5ff Fix build 2019-06-19 18:59:31 +01:00
bachinger
66e1211350 allow multiple style rules in a STYLE block of a webvtt file
PiperOrigin-RevId: 253959976
2019-06-19 18:54:41 +01:00
bachinger
5d544974e9 keep notification when stop(false) is called
ISSUE: #6041
PiperOrigin-RevId: 253958225
2019-06-19 18:53:43 +01:00
tonihei
8286e1d725 Prevent negative renderer timestamps when seeking back.
We are currently queuing periods in a way such that the new start position
lines up with the end of the previous period (to ensure continuous playback).
However, if the start position of the new period is larger than the total of
all previously played period durations, we may end up with negative renderer
timestamps when seeking back to the beginning of this new period. Negative
timestamps should be avoided as most decoders have problems handling them
correctly.

This change forces a renderer reset if we detect such a seek to a negative
renderer time and also resets the renderer offset to 0 every time all
renderers are disabled, as this is the only time where we can savely change
the offset of an existing media period.

Also, if playback starts with an ad, we choose the content position as
renderer offset to prevent the whole issue from occurring for the seek-behind-
midroll case.

Issue:#6009
Issue:#5323
PiperOrigin-RevId: 253790054
2019-06-19 18:52:56 +01:00
olly
def01f68b9 Let AudioTrack write headers on SDK_INT >= 26
Issue: #6031
PiperOrigin-RevId: 253784986
2019-06-19 18:52:20 +01:00
aquilescanta
d072a5261e Fix application of maxAudioBitrate for adaptive audio track groups
Issue:#6006
PiperOrigin-RevId: 253781533
2019-06-19 18:52:13 +01:00
tonihei
9da2c3305b Prevent negative total buffered duration at the point where it is calculated.
In some edge cases the renderer position may be slightly ahead of the
buffered position and the total buffered duration is thus negative. We already
filter that in ExoPlayerImpl for the publicly accessible value. However, we
forward the unfiltered value to other components like the LoadControl, which
may be confusing.

Issue:#6015
PiperOrigin-RevId: 253780460
2019-06-19 18:51:38 +01:00
aquilescanta
a090f7ecca Remove unused variable
PiperOrigin-RevId: 253762488
2019-06-19 18:51:33 +01:00
tonihei
e1ff3d028f Gracefully handle revoked ACCESS_NETWORK_STATE permission.
This permission has normal access right and can't be revoked by the user.
However, an app can choose to revoke it when using ExoPlayer, e.g. if
no network is required and the app doesn't want to list this permission.

Support this use case by gracefully catching the exception in the relevant
places.

Issue:#6019
PiperOrigin-RevId: 253759332
2019-06-19 18:51:25 +01:00
Toni
7f435b4787 Merge pull request #6036 from angelrc96:dev-v2
PiperOrigin-RevId: 253228214
2019-06-19 18:50:33 +01:00
arodriguez
692f4152d5 Support for UDP data source 2019-06-19 18:49:41 +01:00
olly
d3967b557a Don't throw DecoderQueryException from getCodecMaxSize
It's only thrown in an edge case on API level 20 and below. If it
is thrown it causes playback failure when playback could succeed,
by throwing up through configureCodec.

It seems better just to catch the exception and have the codec be
configured using the format's own width and height.

PiperOrigin-RevId: 251745539
2019-06-06 17:41:52 +01:00
olly
edee3dd340 Bump to 2.10.2
PiperOrigin-RevId: 251216822
2019-06-03 19:20:22 +01:00
andrewlewis
578abccf16 Add SilenceMediaSource
Issue: #5735
PiperOrigin-RevId: 248745617
2019-06-03 16:37:39 +01:00
tonihei
d11778dbc8 Add ResolvingDataSource for just-in-time resolution of DataSpecs.
Issue:#5779
PiperOrigin-RevId: 249234058
2019-06-03 16:36:23 +01:00
Oliver Woodman
19de134aa6 CEA608: Handling XDS and TEXT modes 2019-06-03 16:35:11 +01:00
eguven
c231e1120e Fix misreporting cached bytes when caching is paused
When caching is resumed, it starts from the initial position. This makes
more data to be reported as cached.

Issue:#5573
PiperOrigin-RevId: 250678841
2019-05-31 23:03:59 +01:00
eguven
811cdf06ac Modify DashDownloaderTest to test if content length is stored
PiperOrigin-RevId: 250655481
2019-05-31 23:01:21 +01:00
eguven
bbf8a9ac13 Simplify CacheUtil
PiperOrigin-RevId: 250654697
2019-05-31 23:01:15 +01:00
eguven
92e2581e23 Fix CacheUtil.cache() use too much data
cache() opens all connections with unset length to avoid position errors.
This makes more data then needed to be downloading by the underlying
network stack.

This fix makes makes it open connections for only required length.

Issue:#5927
PiperOrigin-RevId: 250546175
2019-05-31 23:01:01 +01:00
tonihei
25e93a178a Toggle playback controls according to standard Android click handling.
We currently toggle the view in onTouchEvent ACTION_DOWN which is non-standard
and causes problems when used in a ViewGroup intercepting touch events.

Switch to standard Android click handling instead which is also what most
other player apps are doing.

Issue:#5784
PiperOrigin-RevId: 245219728
2019-05-31 22:57:50 +01:00
tonihei
b9f3fd429d Make parallel adaptive track selection more robust.
Using parallel adaptation for Formats without bitrate information currently
causes an exception. Handle this gracefully and also cases where all formats
have the same bitrate.

Issue:#5971
PiperOrigin-RevId: 250682127
2019-05-31 22:46:13 +01:00
olly
9860c486e0 Keep controller visible on d-pad key events
PiperOrigin-RevId: 250661977
2019-05-31 22:45:24 +01:00
aquilescanta
9da9941e38 Fix TTML bitmap subtitles
+ Use start for anchoring, instead of center.
+ Add the height to the TTML bitmap cue rendering layout.

Issue:#5633
PiperOrigin-RevId: 250519710
2019-05-31 22:41:10 +01:00
andrewlewis
082aee692b Allow passthrough of E-AC3-JOC streams
PiperOrigin-RevId: 250517338
2019-05-31 22:40:25 +01:00
andrewlewis
8bc14bc2a9 Allow enabling decoder fallback in DefaultRenderersFactory
Also allow enabling decoder fallback with MediaCodecAudioRenderer.

Issue: #5942
PiperOrigin-RevId: 250301422
2019-05-31 22:38:32 +01:00
aquilescanta
42ffc5215f Fix anchor usage in SubtitlePainter's setupBitmapLayout
According to Cue's constructor (for bitmaps) documentation:
+ cuePositionAnchor does horizontal anchoring.
+ cueLineAnchor does vertical anchoring.

Usage is currently inverted.

Issue:#5633
PiperOrigin-RevId: 250253002
2019-05-31 22:37:14 +01:00
olly
9b104f6ec0 Reset upstream format when empty track selection happens
PiperOrigin-RevId: 249819080
2019-05-31 22:36:16 +01:00
olly
2e1ea379c3 Fix IndexOutOfBounds when there are no available codecs
PiperOrigin-RevId: 249610014
2019-05-31 22:34:50 +01:00
tonihei
cf93b8e73e Release DownloadHelper automatically if preparation failed.
This prevents further unexpected updates if the MediaSource happens to
finish its preparation at a later point.

Issue:#5915
PiperOrigin-RevId: 249439246
2019-05-31 22:34:01 +01:00
olly
94c10f1984 Propagate attributes to DefaultTimeBar
Issue: #5765
PiperOrigin-RevId: 249251150
2019-05-31 22:31:53 +01:00
andrewlewis
1d0618ee1a Update surface directly from SphericalSurfaceView
The SurfaceListener just sets the surface on the VideoComponent, but
SphericalSurfaceView already accesses the VideoComponent directly so it seems
simpler to update the surface directly.

PiperOrigin-RevId: 249242185
2019-05-31 22:30:30 +01:00
andrewlewis
e4d66c4105 Update a reference to SimpleExoPlayerView
PiperOrigin-RevId: 249068395
2019-05-31 22:29:56 +01:00
bachinger
b4d72d12f7 Add ProgressUpdateListener
Issue: #5834
PiperOrigin-RevId: 249067445
2019-05-31 22:29:40 +01:00
andrewlewis
9ec330e7c7 Fix platform scheduler javadoc
PiperOrigin-RevId: 248503971
2019-05-17 11:35:38 +01:00
olly
15b319cba2 Bump release to 2.10.1 and update release notes
PiperOrigin-RevId: 248503235
2019-05-17 11:35:22 +01:00
olly
7f89fa9a8c Add simpler HttpDataSource constructors
PiperOrigin-RevId: 248350557
2019-05-15 20:03:52 +01:00
aquilescanta
6e9df31e7d Add links to the developer guide in some READMEs
PiperOrigin-RevId: 248221982
2019-05-15 20:03:46 +01:00
olly
3ce0d89c56 Allow empty values in ICY metadata
Issue: #5876
PiperOrigin-RevId: 248119726
2019-05-15 20:03:39 +01:00
bachinger
cea3071b33 Fix rendering DVB subtitle on API 28.
Issue: #5862
PiperOrigin-RevId: 248112524
2019-05-15 20:03:25 +01:00
olly
48de1010a8 Allow line terminators in ICY metadata
Issue: #5876
PiperOrigin-RevId: 247935822
2019-05-15 20:02:34 +01:00
tonihei
1b9d018296 Fix Javadoc links.
PiperOrigin-RevId: 247630389
2019-05-15 20:00:06 +01:00
tonihei
6ead14880b Add setCodecOperatingRate workaround for 48KHz audio on ZTE Axon7 mini.
Issue:#5821
PiperOrigin-RevId: 247621164
2019-05-15 19:59:40 +01:00
tonihei
ac07c56dab Fix NPE in HLS deriveAudioFormat.
Issue:#5868
PiperOrigin-RevId: 247613811
2019-05-15 19:58:44 +01:00
andrewlewis
29add854af Update player accessed on wrong thread URL
PiperOrigin-RevId: 247418601
2019-05-15 19:55:30 +01:00
tonihei
ee5981c02d Ensure messages get deleted if they throw an exception.
If a PlayerMessage throws an exception, it is currently not deleted from the
list of pending messages. This may be problematic as the list of pending
messages is kept when the player is retried without reset and the message is
sent again in such a case.

PiperOrigin-RevId: 247414494
2019-05-15 19:55:20 +01:00
andrewlewis
85a86e434a Increase gapless trim sample count
PiperOrigin-RevId: 247348352
2019-05-15 19:55:07 +01:00
tonihei
0698bd1dbb Add option to clear all downloads.
Adding an explicit option to clear all downloads prevents repeated database
access in a loop when trying to delete all downloads.

However, we still create an arbitrary number of parallel Task threads for this
and seperate callbacks for each download.

PiperOrigin-RevId: 247234181
2019-05-15 19:54:27 +01:00
eguven
b626dd70c3 Add DownloadHelper.createMediaSource utility method
PiperOrigin-RevId: 245243488
2019-05-15 19:47:43 +01:00