2644 Commits

Author SHA1 Message Date
olly
f116f29812 Prevent leaking of the Thread.interrupt flag to other LoadTasks
PiperOrigin-RevId: 311290214
2020-05-29 21:15:17 +01:00
samrobinson
ad1dffcae8 Make the base values of SilenceSkippingAudioProcessor configurable.
Issue:#6705
PiperOrigin-RevId: 310907118
2020-05-29 21:15:17 +01:00
samrobinson
8304cf3480 Change SilenceSkippingAudioProcessor to not rely on the frame MSB.
PiperOrigin-RevId: 309925306
2020-05-29 21:15:17 +01:00
tonihei
d159f622c2 Update initial bitrate estimates.
PiperOrigin-RevId: 309720018
2020-05-29 21:15:17 +01:00
olly
2fa2fb73b7 Catch correct exception from Context.startService
Issue: #7306
PiperOrigin-RevId: 309392633
2020-05-29 21:15:17 +01:00
Oliver Woodman
7414a86fe0 Let MediaSourceFactory setDrmSessionManager accept null
Issue: #7168
2020-05-29 21:15:17 +01:00
Oliver Woodman
dfc3c507a0 Don't allow bad MediaSource release implementation to crash player.
This also allows subsequent MediaSource instance in the list to still
be released successfully.

Issue: #7168
2020-05-29 21:15:17 +01:00
olly
1772b0d917 ConditionVariable: Fix block(long) to correctly handle large timeouts
PiperOrigin-RevId: 308815613
2020-05-27 20:35:00 +01:00
olly
9213ffafa8 ConditionVariable: Improve documentation and allow clock injection
- Improve documentation explaining the benefits of ExoPlayer's ConditionVariable
  over the one that the platform provides
- Allow Clock injection
- Create TestUtil method for obtaining a ConditionVariable whose block(long)
  method times out correctly when used in a Robolectric test
- Add basic unit tests for ConditionVariable

PiperOrigin-RevId: 308812698
2020-05-27 20:33:54 +01:00
christosts
3ac4c1a6e5 Add Clock#currentTimeMillis()
PiperOrigin-RevId: 306602043
2020-05-27 20:31:38 +01:00
aquilescanta
49e5e66033 Fix NPE when reading from a SampleQueue from a loading thread
Issue: #7273
PiperOrigin-RevId: 308238035
2020-05-27 20:22:32 +01:00
aquilescanta
7ee08f09d2 Fix AdsMediaSource parameter when reporting load error
PiperOrigin-RevId: 308041841
2020-05-27 20:10:24 +01:00
tonihei
b954a5aa5f Fix timestamp rounding error in fMP4 extractor.
The sample timestamps are currently rounded to milliseconds, only to
be multiplied by 1000 later. This causes rounding errors where the sample
timestamps don't match the timestamps in the seek table (which are already
in microseconds).

issue:#7086
PiperOrigin-RevId: 307630559
2020-05-27 20:07:46 +01:00
olly
a697905cfb Fix H265Reader to correctly output SEI and AUD NAL units
Issue: #7113
PiperOrigin-RevId: 307380133
2020-05-27 20:07:46 +01:00
olly
190d81f0f6 Noop naming generalization for H265Reader
This change generalizes the concept of "reading parameter sets" to
"reading prefix NAL units", ahead of a change that will treat AUD
and suffix SEI NAL units in the same way.

The change also introduces some static isXxxNalUnit methods for
clarity.

Issue: #7113
PiperOrigin-RevId: 307376967
2020-05-27 20:07:46 +01:00
andrewlewis
e7e74afbff Fix AdsMediaSource child sources not being released
Also add unit tests for AdsMediaSource.

PiperOrigin-RevId: 307365492
2020-05-27 20:07:42 +01:00
andrewlewis
cf52742ad9 Fix gapless playback
Audio processors are now flushed twice after reconfiguration.
The second flush call cleared the pending trim start bytes so
transitions between tracks were no longer gapless.

Fix this by removing logic to clear pending trim bytes on flush.
As a result we may trim data incorrectly if there is a flush
before any data has been handled for seeking to a non-zero
position, but this edge case will happen rarely and the effect
shouldn't be noticeable.

PiperOrigin-RevId: 307344357
2020-05-27 19:36:49 +01:00
Oliver Woodman
ad36f64965 Merge pull request #7210 from nebyan:CacheKeyFactoryNotUsed
PiperOrigin-RevId: 307045655
2020-05-27 19:29:20 +01:00
bachinger
aea9f8e550 Merge pull request #7245 from Clement-Jean:silence-media-source-factory
PiperOrigin-RevId: 307010600
2020-05-27 19:28:30 +01:00
andrewlewis
4dc1d317c3 Fix TeeAudioProcessor sink configuration
TeeAudioProcessor needs to configure its sink when it is initially set up.

PiperOrigin-RevId: 306808871
2020-05-27 19:27:16 +01:00
kimvde
f2d2d56109 Fix H265Reader
Update H265Reader to output the same samples after a seek to 0.

PiperOrigin-RevId: 306675050
2020-05-27 19:25:51 +01:00
aquilescanta
2df9491383 Avoid throwing an exception for sample default values
Allows playback of content when the default value is
not valid, but not used for any samples.

Issue: #7207
PiperOrigin-RevId: 306631376
2020-05-27 19:12:37 +01:00
olly
bdc0db30fd Don't select trick-play tracks by default
Issue: #6054
Issue: #474
PiperOrigin-RevId: 306504362
2020-05-27 19:10:42 +01:00
olly
d538d6ae37 Fix capabilities check for low frame-rate content
Issue: #6054
Issue: #474
PiperOrigin-RevId: 306437452
2020-05-27 19:09:58 +01:00
Oliver Woodman
76374d7822 Clean up playWhenReady 2020-04-08 22:11:33 +01:00
olly
f696a56b56 Audio focus: Restore full volume if focus is abandoned when ducked
If we're in the ducked state and updateAudioFocus is called with a
new state for which focus is no longer required, we should restore
the player back to full volume.

Issue: #7182
PiperOrigin-RevId: 305232155
2020-04-07 14:12:30 +01:00
Oliver Woodman
49858b82f2 Merge pull request #7184 from TiVo:p-subtitle-format-from-codecs
PiperOrigin-RevId: 305137114
2020-04-07 14:12:06 +01:00
olly
cc29798d9b Audio focus: Re-request audio focus if in a transient loss state
This avoids cases where audio focus is never successfully acquired
because another app is holding on to transient audio focus indefinitely.

Issue: #7182
PiperOrigin-RevId: 305108528
2020-04-07 14:02:46 +01:00
tonihei
3c0e617837 Merge AudioFocusManager methods to simplify control flow.
handlePrepare/Stop/SetPlayReady can be merged together as they all
handle changes to the desires state of the player.

Also, simplify parts of the control flow by not mixing code that
determines if audio focus needs to be handled with code that actually
acquires or abandons the focus.

PiperOrigin-RevId: 299824857
2020-04-07 14:01:54 +01:00
andrewlewis
07cbfb65e5 Fix stuck ad playbacks with DRM-protected content
When ClippingMediaPeriod first tried to read a buffer, if its end
position was before the end of the stream and it was buffered to its end
position, it would sometimes erroneously signal end-of-stream for
protected content because the sample queue might be waiting for DRM keys
at this point.

Work around the issue temporarily by signaling this specific case back
to ClippingMediaPeriod via the DecoderInputBuffer.

There will likely be a cleaner fix as a result of adding support for
dynamic clip end points in the future, at which point this can be
reverted.

issue:#7188
PiperOrigin-RevId: 305081757
2020-04-07 13:49:54 +01:00
Oliver Woodman
d4d7907193 Revert "Remove duplicate SCTE-35 format and add sample to TsExtractorTest"
This reverts commit 8591e69b6a40162ffc801a1569549ca826606cc5.
2020-04-07 13:43:28 +01:00
Oliver Woodman
f14c028078 Fix dump files for release 2020-04-03 22:57:06 +01:00
samrobinson
b8e6e98430 Simplify WakeLockManager and WifiLockManager logic.
Disabling reference counting allows some checks to be removed.

This is a no-op.

PiperOrigin-RevId: 299829600
2020-04-03 22:52:40 +01:00
samrobinson
83c2ca5902 Add WifiLock management to SimpleExoPlayer.
Issue:#6914
PiperOrigin-RevId: 297598910
2020-04-03 22:52:35 +01:00
samrobinson
e4e56fac09 Clean WakeLockManager.updateWakeLock logic.
PiperOrigin-RevId: 284552723
2020-04-03 22:49:03 +01:00
kimvde
d921491e7d Remove thread checks in player constructor
SimpleExoPlayer instances don't have to be created from the application
thread.

PiperOrigin-RevId: 304190901
2020-04-01 23:04:51 +01:00
olly
38f282800c Fix ADTS extraction with mid-stream ID3
PiperOrigin-RevId: 304184650
2020-04-01 23:04:36 +01:00
Oliver Woodman
c75f3f77ff Merge pull request #7099 from matamegger:feature/fix_pssh_v1_on_firetv
PiperOrigin-RevId: 303937576
2020-04-01 22:58:03 +01:00
olly
1f44a4db4b Bump version to 2.11.4
PiperOrigin-RevId: 303776645
2020-03-30 19:27:23 +01:00
andrewlewis
fea0acd41a Fix PlaybackStatsListener behavior when not keeping history
issue:#7160
PiperOrigin-RevId: 303747338
2020-03-30 18:36:10 +01:00
olly
f0e734d33e Workaround C2 AAC decoder flush problem on Android 10
Issue: #6671
PiperOrigin-RevId: 303364788
2020-03-30 18:36:07 +01:00
olly
a9cbbf91c3 Skip aliases of other codecs
- They are always listed with their canonical names
- Considering aliases means that blacklisting a decoder can end up
  not actually blacklisting it, since it may still be accessible
  via an alias. It also means that our decoder fallback logic can
  end up falling back to a decoder that we've already tried!

PiperOrigin-RevId: 303348297
2020-03-30 18:31:24 +01:00
ibaker
c9f28086db Make milliseconds optional in SubRip (SRT) subtitles
issue:#7122
PiperOrigin-RevId: 303154493
2020-03-30 18:31:24 +01:00
olly
a038346ecc Resample float audio to 16-bit by default to enable audio processing
This is less confusing than having audio processing functionality (e.g., playback
speed adjustment) just "not work" for some pieces of media.

If this change is merged, I will update #6749 to also track making DefaultAudioSink
intelligently enable/disable float output depending on how the audio processors are
configured.

Issue: #7134
PiperOrigin-RevId: 302871568
2020-03-30 18:31:24 +01:00
olly
ddc98334e0 DefaultAudioSink: Fix issue if last processor is not active
It's incorrect to use an AudioFormat returned from AudioProcessor.configure
unless the AudioProcessor is active.

Issue: #7134
PiperOrigin-RevId: 302674132
2020-03-30 18:31:24 +01:00
olly
54c608481b Support 32-bit FP to 16-bit Int audio resampling
This is a no-op for DefaultAudioSink for now, because DefaultAudioSink
currently disables processing anyway if the input uses ENCODING_PCM_FLOAT.

Issue: #7134
PiperOrigin-RevId: 302670534
2020-03-30 18:31:24 +01:00
olly
2094c7491b WAV: Don't read past data end position
Issue: #7129
PiperOrigin-RevId: 302660343
2020-03-30 18:31:24 +01:00
olly
1d6bd0de15 MP4 edit lists: Use floor rather than ceil to find first sample
If the start time of the edit falls within a sample, start from that
sample rather than the next one. This ensures playback can start from
the correct point if the sample is a keyframe, rather than having to
start from the next one.

Issue: #7133
PiperOrigin-RevId: 302639115
2020-03-30 18:31:24 +01:00
ibaker
d18292c9c9 Allow missing hours in SubRip (.srt) subtitle timecodes
Add a test for this case, and extend the existing tests to ensure the
hour is parsed when it's present.

issue:#7122
PiperOrigin-RevId: 302472213
2020-03-30 18:31:23 +01:00
krocard
cac36be6eb Conserve ByteOrder when growingDecoderInputBuffer
#exo-offload

PiperOrigin-RevId: 302403507
2020-03-30 18:31:23 +01:00