1. 07 Jul, 2022 1 commit
    • Don't block AudioTrack when waiting for previous release · 9af65a90
      We wait until a previous AudioTrack has been released before
      creating a new one. This is currently done with a thread
      block operation, which may cause ANRs in the extreme case
      when someone attempts to release the player while this is
      still blocked.
      
      The problem can be avoided by just returning false from
      DefaultAudioSink.handleBuffer to try again until the previous
      AudioTrack is released.
      
      Reproduction steps to force the issue:
      1. Add Thread.sleep(10000); to the AudioTrack release thread.
      2. Add this to the demo app:
          private int positionMs = 0;
      
          Handler handler = new Handler();
          handler.post(new Runnable() {
            @Override
            public void run() {
              player.seekTo(positionMs++);
              if (positionMs == 10) {
                player.release();
              } else {
                handler.postDelayed(this, 1000);
              }
            }
      3. Observe Player release timeout exception.
      
      These steps can't be easily captured in a unit test as we can't
      artifically delay the AudioTrack release from the test.
      
      Issue: google/ExoPlayer#10057
      PiperOrigin-RevId: 459468912
      (cherry picked from commit a83ab05a)
      tonihei committed
  2. 06 Jul, 2022 1 commit
  3. 07 Jul, 2022 1 commit
  4. 06 Jul, 2022 1 commit
  5. 05 Jul, 2022 1 commit
  6. 04 Jul, 2022 1 commit
  7. 01 Jul, 2022 5 commits
  8. 29 Jun, 2022 1 commit
  9. 28 Jun, 2022 4 commits
  10. 27 Jun, 2022 2 commits
  11. 23 Jun, 2022 1 commit
  12. 21 Jun, 2022 1 commit
    • Clear pending doSomeWork messages when sleeping for offload · 59fbb455
      The offload sleeping stops as soon as a new DO_SOME_WORK message
      is handled (because this indicates an expected change in rendering
      and we want to stop sleeping until we know it's safe to do so).
      
      Every exit path from doSomeWork needs to clear other pending
      DO_SOME_WORK messages as these requests have already been handled by
      the current method invocation. This currently doesn't happen from the
      offload sleeping return path and a previously queued DO_SOME_WORK
      message can immediately wake up the rendering loop again.
      
      Fix this by moving the message removal to the beginning of the
      doSomeWork method (as it prevents forgetting it in one of the
      exit paths later).
      
      PiperOrigin-RevId: 456259715
      (cherry picked from commit a7649b63)
      tonihei committed
  13. 20 Jun, 2022 1 commit
  14. 16 Jun, 2022 1 commit
  15. 15 Jun, 2022 2 commits
  16. 10 Jun, 2022 1 commit
  17. 07 Jun, 2022 1 commit
  18. 17 Jun, 2022 1 commit
  19. 16 Jun, 2022 5 commits
  20. 15 Jun, 2022 8 commits