We may currently throw if the load completes before we finished preparation.
Don't throw and instead check for this condition in maybeThrowPrepareError.
PiperOrigin-RevId: 237237000
These are thrown for non-IOException encountered during loading. Also, they
are thrown from an unexpected position and retrying is likely to fail anyway
because the Extractor is left in an unrecoverable state.
PiperOrigin-RevId: 237043948
SQLiteException is a runtime exception, which makes it easy to
forget to handle it. This change converts SQLiteExceptions into
a checked exception, which is then handled appropriately.
PiperOrigin-RevId: 237038793
Currently a flags-only DecoderInputBuffer may hold only the end-of-stream
flag. This change makes flags-only buffer read any kind of flag set in
the next sample. If no sample is available RESULT_NOTHING_READ is
returned.
PiperOrigin-RevId: 237027581
nalPrefix.readUnsignedIntToInt() will throw if the unsigned output doesn't fit
in an int. Before this change, in the error case we'd retry reading from after
the NAL prefix position. Throw a ParserException so that reading an obviously
invalid NAL prefix will be treated as a fatal exception by the default load
error handling policy.
PiperOrigin-RevId: 236839690
The release needs to post to the MediaSource thread and also needs to post
back to the DownloadHelper thread to prevent sending updates after release has
been called. The point where we release the downloadHelper also needs to
dismiss the dialog in case the creation has already been queued before the
release.
PiperOrigin-RevId: 236652309
This is more in line with "forgetting all previous state" as documented for
resetState=True. Also only apply the current position as initial seek position
in this case.
PiperOrigin-RevId: 236623630
We currently throw if a pending seek position was valid when the user issued
it on the app thread, but can't be resolved on the playback thread because the
timeline changed in the meantime. Throwing in this case seems wrong as the
user could not have known about the issue (and the seek position was actually
valid). Also, in other cases where the currently playing period is no longer
in the new timeline, we gracefully use a subsequent period or transition to
ENDED state instead of throwing. So it seems more consistent to transition to
ENDED state as well.
PiperOrigin-RevId: 236274862
The flag in ExoPlayer.prepare is documented as keeping the current window
index and window position. We are currently using the current period UID and
period position instead. This causes problems when the media source is changed
but the position is not reset.
Using the initial seek position instead ensures we actually use the window
index and position.
Issue:#5520
PiperOrigin-RevId: 236101024
Adding new error types may cause issues when listeners assume a fixed set of
error types and don't handle arbitrary defaults.
Fixing error handling in one case and improving documentation to make people
aware of the issue.
PiperOrigin-RevId: 236093265
While disabled the renderer does not have non-null stream formats. This means
that setting the operating rate could cause a NullPointerException if there was
a codec for reuse.
Check for being enabled/started before trying to set the operating rate. After
the renderer is enabled it should receive a new input format which will update
the operating rate as needed.
PiperOrigin-RevId: 235494384
If the DefaultAudioSink was reconfigured in a way that was compatible with the
previous configuration just after having been reset, we would try to drain audio
processors despite not having an AudioTrack. This could result in a
NullPointerException if speed adjustment was active.
Fix this behavior by only trying to drain audio processors if we actually have
an AudioTrack.
PiperOrigin-RevId: 235355466
- Expose constructor (package private for now, for tests only)
- Add some tests for cache initialization
- Add some TODOs for handling initialization failure
PiperOrigin-RevId: 235188386
*** Reason for rollback ***
Breaks ExoPlayer's gradle build
*** Original change description ***
Migrate Mockito Matchers.{hamcrestMethods} to MockitoHamcrest.{hamcrestMethods}
All methods accepting a hamcrest Matcher in org.mockito.Matchers have been changed
to only accept an ArgumentMatcher. The corresponding methods are now available on
MockitoHamcrest.
For more information see http://go/mockito-2-lsc
Tested:
TAP --sample for global presubmit queue
http://test/OCL:235033293:BASE:234998256:1550793421835:c2ccbbda
***
PiperOrigin-RevId: 235186705
All methods accepting a hamcrest Matcher in org.mockito.Matchers have been changed
to only accept an ArgumentMatcher. The corresponding methods are now available on
MockitoHamcrest.
For more information see http://go/mockito-2-lsc
Tested:
TAP --sample for global presubmit queue
http://test/OCL:235033293:BASE:234998256:1550793421835:c2ccbbda
PiperOrigin-RevId: 235153912
*** Reason for rollback ***
Reverting as this may break playback on other Amlogic devices and/or playback of non-interlaced content.
*** Original change description ***
Add max video size workaround for Amlogic decoder.
The Amlogic awesome decoder reduces the video size of interlaced videos by half
if the internal configuration isn't force reset with new maximum input size
values. The product of these new values must exceed 1920x1088 to force the
reset.
Issue:#5003
***
PiperOrigin-RevId: 234967314
- Use Cache UID for CacheContentIndex and CacheFileMetadataIndex. This
enables SD card swapping for a single device.
- I'm hopeful of finding a way to get the Cache UID to DefaultDownloadIndex
so we can do the same there.
PiperOrigin-RevId: 234662753
This is a temporary fix to prevent NullPointerException exceptions.
Though writing to cache will still fail if the cache folder isn't a real
folder.
There are a few thing we can try:
* The listing might be failing because the cache folder is just created.
We can wait and try again.
* If the cache folder is a regular file, we can try deleting and creating
a folder with the same name.
PiperOrigin-RevId: 234121925
Previously we would get a new AudioTrack and flush all audio processors if any
AudioProcessor needed to be flushed on reconfiguration. This was problematic for
the case of TrimmingAudioProcessor because it could become active or inactive
due to transitioning to a period with gapless metadata or without it (we don't
keep it active all the time because it is wasteful to populate its end buffer
for content that is not gapless).
This change handles the case where we don't need an AudioTrack but
AudioProcessors do need to be flushed. In this case we drain all the audio
processors when next handling data then switch to the new configuration.
This avoids truncation when period transitions change whether
TrimmingAudioProcessor is active but don't require a new AudioTrack, and is also
a step towards draining the AudioTrack when transitioning between periods if we
do need a new AudioTrack.
To do this, it needs to be possible to drain any pending output data from an
AudioProcessor after it's configured to a new format, so this change makes sure
AudioProcessors allow calling playToEndOfStream and getOutput after
reconfiguration and before flush.
PiperOrigin-RevId: 234033552
This cleanup is in preparation for draining audio processors on reconfiguration
to a format that doesn't require a new AudioTrack to be created.
PiperOrigin-RevId: 233990983
Stop encoding/decoding presentation time as part of the message.
What's actually in emsg boxes is a presentation time delta,
which is why it's only 32 bits, and hence why it doesn't handle
large absolute timestamps. We were using this field to hold
absolute timestamps only for the purpose of passing presentation
times from DashManifestParser.parseEvent back to the calling
method. After this change, we return Pair<Long, EventMessage>
instead.
Issue: #5490
PiperOrigin-RevId: 233561731