1. 20 Jul, 2023 1 commit
    • Tighten the demo app's handling of `DrmInitData` for downloads · 96083199
      This code is Widevine specific. `OfflineLicenseHelper.downloadLicense`
      requires the passed `Format` to have a `DrmInitData.SchemeData` with
      Widevine UUID and non-null `data` field. The demo app tries to check
      this in advance (to avoid an exception later), but its checks are
      looser than those made by `OfflineLicenseHelper`. This change tightens
      the checks to match.
      
      Issue: androidx/media#512
      PiperOrigin-RevId: 549587506
      (cherry picked from commit b7988e2c856ca05e28d862c8a7c7739402d4d40d)
      ibaker committed
  2. 19 Jul, 2023 1 commit
    • Add field measured throughput (mtp) · 6c6d50d3
      Updated `ExoTrackSelection` to provide the most recent bitrate estimate, enabling the inclusion of measured throughput (mtp) as a CMCD-Request field in Common Media Client Data (CMCD) logging.
      
      Additionally, made changes to the `checkArgument` methods in `CmcdLog` to prevent the use of default values in certain cases.
      
      #minor-release
      
      PiperOrigin-RevId: 549369529
      (cherry picked from commit 79696182226b10dce2ac2756f317d217a8bcf23c)
      rohks committed
  3. 18 Jul, 2023 1 commit
  4. 17 Jul, 2023 1 commit
    • Fix race condition in clipped sample streams · 7feb2089
      The streams return end-of-input if they read no samples, but know that
      they are fully buffered to at least the clipped end time. This helps to
      detect the end of stream even if there are no new buffers after the end
      of the clip (e.g. for sparse metadata tracks).
      
      The race condition occurs because the buffered position is evaluated
      after reading the sample. So between reading "no sample" and checking
      the buffered position, the source may have loaded arbitrary amounts
      of data. This may lead to a situation where the source has not read
      all samples, reads NOTHING_READ (because the queue is empty) and then
      immediately returns end-of-stream (because the buffered position
      jumped forward), causing all remaining samples in the stream to be
      skipped. This can fixed by moving the buffered position check to
      before reading the sample, so that it never exceeds the buffered
      position at the time of reading "no sample".
      
      #minor-release
      
      PiperOrigin-RevId: 548646464
      (cherry picked from commit b3a7ff91d6f4c3454085fe28903f42ede3d03ac1)
      tonihei committed
  5. 14 Jul, 2023 3 commits
  6. 13 Jul, 2023 1 commit
  7. 12 Jul, 2023 1 commit
  8. 10 Jul, 2023 1 commit
  9. 06 Jul, 2023 3 commits
  10. 05 Jul, 2023 1 commit
    • Replace `BitArray.skipBytes()` with `BitArray.skipBits()` · 70e9a26f
      Based on the spec, ETSI TS 102 366 V1.4.1 Annex F, 6 bits should have skipped instead of 6 bytes.
      
      This correction was pointed out in Issue: androidx/media#474.
      
      PiperOrigin-RevId: 545658365
      (cherry picked from commit 0f5b2cf9facbc8adac0d115896792de8db955da2)
      rohks committed
  11. 04 Jul, 2023 1 commit
  12. 03 Jul, 2023 1 commit
  13. 30 Jun, 2023 2 commits
    • CEA-608: Only truncate to 32 visible characters · d876028a
      We introduced truncation to 32 chars in <unknown commit>
      and included indent and offset in the calculation. I think this is
      technically correct, but it causes problems with the content in
      Issue: google/ExoPlayer#11019 and it doesn't seem a problem to only truncate actual
      cue text (i.e. ignore offset and indent).
      
      #minor-release
      
      PiperOrigin-RevId: 544677965
      (cherry picked from commit d5e45209eeb7b3ce96cc9dcf32ea98bb42cf12ce)
      ibaker committed
    • Remove dead code in ProgressiveMediaSource.Builder · f729b6d8
      These fields cannot be set and the logic to handle them can be removed.
      
      PiperOrigin-RevId: 544646460
      (cherry picked from commit d5ba034e1f7435c55f52126be53a09a7f3bc37a9)
      tonihei committed
  14. 05 Jul, 2023 1 commit
  15. 28 Jun, 2023 2 commits
    • Ensure that ShuffleOrder has the same length as the current playlist · c033263d
      Add a fail-fast check in `ExoPlayerImpl` to ensure the equality of the lengths of `ShuffleOrder` and the current playlist. Also improve the documentation of `setShuffleOrder(ShuffleOrder)` with explicit instruction on this.
      
      Issue: androidx/media#480
      
      #minor-release
      
      PiperOrigin-RevId: 544009359
      (cherry picked from commit 9cabbc9badbc9301f5e13398b8444377c4e72543)
      tianyifeng committed
    • Clarify MediaPeriod.readDiscontinuity Javadoc · f6042d63
      It currently wrongly documents that it is only called before reading
      streams (that has never been the case and all MediaPeriods already need
      to handle calls after reading samples from the streams).
      
      It was also a bit unclear what a discontinuity implies and the new
      Javadoc calls out the main use case for discontinuties and the intended
      meaning of returning a discontinuity.
      
      #minor-release
      
      PiperOrigin-RevId: 543989124
      (cherry picked from commit 7530c45cb60f212d9d65c24f40a45fe666416ad5)
      tonihei committed
  16. 26 Jun, 2023 3 commits
  17. 22 Jun, 2023 1 commit
  18. 20 Jun, 2023 4 commits
    • Switch to SVG assets hosted on developer.android.com for reference docs · 8a4c944c
      #minor-release
      
      PiperOrigin-RevId: 541970884
      (cherry picked from commit ce466b742bc8edebef363aa79ec2c91fb40df5cd)
      ibaker committed
    • Fix ArrayIndexOutOfBoundIndex when re-preparing after exception · a72f1b2d
      When an app tried to re-prepare a live streeam with server side inserted
      ad after a playback exception, the player tried to find the ad group by
      its index in the ad playback state of the next timeline when creating
      the first period.
      
      If a source that supports server side ad, has removed the ad playback
      state when the source has been removed, this causes a crash. For live
      streams this is a reasonable thing to do given the exception could be
      caused by an invalid ad playback state.
      
      This change removes the ad metadata from the current period for live
      streams and the timeline. In case the ad playback state is not reset
      by the source, the first timeline refresh would ad the metadata again.
      
      PiperOrigin-RevId: 541959628
      (cherry picked from commit 207ef0d0f0bee86e75409f53ded325e859ca25aa)
      bachinger committed
    • Fix spurious sessions created for events after the playlist is cleared · 12cd9e81
      Some events may arrive after the playlist is cleared (e.g. load
      cancellation). In this case, the DefaultPlaybackSessionManager may
      create a new session for the already removed item.
      
      We already have checks in place that ignore events with old
      windowSequenceNumbers, but these checks only work if the current
      session is set (i.e. the playlist is non-empty). The fix is to add
      the same check for empty playlists by keeping note of the last
      removed window sequence number.
      
      PiperOrigin-RevId: 541870812
      (cherry picked from commit 656e0723e51e1bc38d558e77fa2cb0cc17e37054)
      tonihei committed
    • Merge pull request #436 from jaeho-lee104:feature/improve_condition · 38032a6e
      PiperOrigin-RevId: 540875285
      (cherry picked from commit 9fd38c16eeb9e64ff62a0a47ae6e174bb8de8d43)
      Ian Baker committed
  19. 15 Jun, 2023 2 commits
    • Refactor method `CmcdLog.createInstance` to accept `bufferedDurationUs` · b16238a3
      Instead of providing `playbackDurationUs` and `loadPositionUs` individually, which are used to calculate the buffer duration for CMCD logging, we can directly pass the pre-calculated `bufferedDurationUs` available in the `getNextChunk` method of the chunk source classes.
      
      Issue: google/ExoPlayer#8699
      
      #minor-release
      
      PiperOrigin-RevId: 540630112
      (cherry picked from commit 4d1119ab24384621877f4e7854dca1fa6db964a3)
      rohks committed
    • Add CMCD logging when requesting initialization chunk for DASH and HLS · fd060619
      Additionally, two existing methods to `buildDataSpec` in `DashUtil` have been deprecated, while a new method has been added that allows the inclusion of `httpRequestHeaders`.
      
      Issue: google/ExoPlayer#8699
      
      #minor-release
      
      PiperOrigin-RevId: 540594444
      (cherry picked from commit c69b6fe41d065175dacc22b1b30efed91b8102f1)
      rohks committed
  20. 14 Jun, 2023 3 commits
    • Remove `=` from parameter args in call to `Constructor.newInstance` · 593590c0
      These comments reflect the parameter names of the constructor that
      we're reflectively calling, but errorprone complains that they don't
      match the parameter names of `Constructor.newInstance`.
      
      PiperOrigin-RevId: 540348118
      (cherry picked from commit 2b53f100f858e36159ab636e82bcb07d26868150)
      ibaker committed
    • Stop suppressing exceptions in `MediaCodec.Callback` during flush · eb5ffeb0
      Previously `AsynchronousMediaCodecCallback.mediaCodecException` was
      cleared when flushing completed. This behaviour was changed in
      https://github.com/google/ExoPlayer/commit/aeff51c50772a82e44045e7d80e8a13390e2bb36
      so now the exception is not cleared.
      
      The result after that commit was that we would **only** suppress/ignore
      the expression if a flush was currently pending, and we would throw it
      both before and after the flush. This doesn't really make sense, so this
      commit changes the behaviour to also throw the exception during the
      flush.
      
      This commit also corrects the assertion in
      `flush_withPendingError_resetsError` and deflakes it so that it
      consistently passes. The previous version of this test, although the
      assertion was incorrect, would often pass because the
      `dequeueInputBuffer` call would happen while the `flush` was still
      pending, so the exception was suppressed.
      
      #minor-release
      
      PiperOrigin-RevId: 540237228
      (cherry picked from commit dd17e73629930628e5cb313301ceabf0c776bd18)
      ibaker committed
    • Add missing @Override · 1e6dd8a2
      PiperOrigin-RevId: 540220141
      (cherry picked from commit 1434c61bf5e8a92d90cadc39e66e5edb993b9a84)
      tonihei committed
  21. 12 Jun, 2023 3 commits
  22. 11 Aug, 2023 1 commit
    • Stop setting `-no-module-directories` in ExoPlayer javadoc generation · 0c58f15f
      This flag was introduced to fix links in javadoc search when generating
      it with Java 11: <unknown commit>
      
      The flag is no longer supported with Java 17 (which is required for
      Gradle 8.0+), and seems to no longer be needed: I generated the javadoc
      with it removed and the search links work OK.
      
      PiperOrigin-RevId: 536738686
      ibaker committed
  23. 05 Jul, 2023 1 commit
  24. 26 Jun, 2023 1 commit