Also convert left side from milliseconds to microseconds for comparison
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=189784833
Add logic to poll AudioTimestamp at different rates depending on when
playback starts and how the audio timestamp advances.
This fixes a pause about 500 ms after starting playback that occurs on some
devices and also makes our polling interval match the recommendations of the
AudioTrack documentation.
Issue: #3830
Issue: #3841
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=189765200
When creating DeferredMediaPeriods, we don't know the actual timeline yet and
thus the default position is also unknown. We can still forward the correct
default position by forwarding it the deferred media period as soon as it
becomes known.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=189763460
As part of pausing DefaultAudioSink, its position-related fields are reset. If
the audio timestamp API was in use, this results in falling back to the
getPlaybackHeadPosition API, which (on some devices) can lead to a jump in the
reported position.
Sample the position before pausing instead of after, to avoid this jump.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=189713376
This is achieved by automatically registering a listener for child sources in
compositions. The composite media source has the chance to correct the
reported window index and media period id in the MediaLoadData of the events.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=189575414
Currently, whenever the clipping is updated, we move the time frame of the
clipped period to start at 0. This causes problems when we are already playing
this period and the renderer position does no longer match the stream
positions.
This change keeps the time frame of the clipped media period as it is and
instead specifies the offset of the window in the period.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=189570277
DefaultAudioSink had a lot of code related to tracking the position of the
underlying AudioTrack, and working around issues with the position APIs.
Move this code to a separate class responsible for position tracking. This is in
preparation for improving the audio timestamp polling behavior.
This change is intended not to cause any behavior changes.
Issue: #3841
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=189344743
This allows to test sending events when using fake media sources.
The FakeMediaSource now simulates a manifest load when being prepared.
And the FakeMediaPeriod simulates a media load when being prepared.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=189205285
Currently, we are treating all codecs starting with "mp4a" as AAC. However,
some codec strings starting with "mp4a" are not AAC format, as should be
treated differently.
GitHub: #3779
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=189163517
This is a step towards factoring out position tracking functionality.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=189155624
This is a first step towards factoring out position tracking functionality.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=189027731
This allows to distinguish between media source events of multi-window and
multi-period media sources. In this change, only media sources currently reporting
events are changed. Proper support in composite sources will be added in a later
change.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=188847366
This change also simplifies reporting the right media source events in a
future change.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=188718504
This is achieved by moving the listener registration and the creation of the
event dispatcher into BaseMediaSource.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=188461932
As it turns out there isn't much gain by subclassing
AbstractContentMetadata. Moved abstract onChange method to a listener
interface.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=188353673
This allows to keep the same window sequence number if playback fails and
is then retried without resetting the position.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=188339509
The value is increased to 50 seconds. With that the player can better handle
short network problems. This does NOT increase the maximum memory used as we
still apply the seperate DEFAULT_TARGET_BUFFER_BYTES.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=188335603
When creating a new AC-3 passthrough AudioTrack the position
may advance from an old AudioTrack's position. The workaround
checked for the playback head position returning to zero, but
a subsequent change meant that we'd always start writing data
to the new track immediately (rather than waiting for its
position to 'stabilize' at zero).
Fix the issue by using the AudioTrack position directly. (Nb.
this doesn't handle the case of the stale position before
unwrapping being zero, but it is very unlikely to occur.)
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=188319795
Also simplified shouldContinueLoading condition code and added a builder for DefaultLoadControl.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=188306213
This allows to know the duration immediately and fixes the temporary unknown
duration in the UI when repreparing the same extractor media source.
The isSeekable property is still reset to false as we can't actually seek
until the seek map has been reloaded.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=188145860
Also remove logic for tracking the next output buffer in LibvpxVideoRenderer, as
this allowed many consecutive frames to be rendered that were actually late
after dropping to keyframe. It looks better to show frames at a consistent
100 ms rate.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=188144739
The playback state in ExoPlayerImpl and ExoPlayerImplInternal is usually kept
in sync. Only the timeline was so far not updated in the same way with the
internal player using a null timeline while ExoPlayerImpl keeps the previous
timeline.
This change removes the need to keep a null timeline which allows to update
the internal timeline in the same way as the external one. This fixes problems
when retrying a failed playback multiple times.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=188034988
The start position was set to the old start position instead of the current
playback position. We need to set the start position to the current playback
position to ensure a repreperation with the same media starts from the last
playback position.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=188025439
Previously, child source ids were reassigned when the media source is reused.
Now the creation of the ids moved to outer level to stay in sync with the list
of child media sources.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=188014739
This restores functionality that was lost when we added
support for general timed message delivery.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=187866807
This value can now be set in the DefaultBandwidthMeter instead. As a result
NO_VALUE can be removed from BandwidthMeter as we now always provide an
estimate.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=187865341
This simplifies clearing a playlist without having to call removeMediaSource
repeatedly. It will also update the timeline only once.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=187863857
There is a large number of repeated arguments in the callback methods of
MediaSourceEventListener. Grouping them into load related data and media
related data allows to significantly reduce the amount of boiler plate code
and also simplifies future extensions of either set of data.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=187857252
This value is logically part of the bandwidth estimation and will eventually be
moved there from the adaptive track selection.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=187597038