Skip to content

Commit

Permalink
Release DownloadHelper automatically if preparation failed.
Browse files Browse the repository at this point in the history
This prevents further unexpected updates if the MediaSource happens to
finish its preparation at a later point.

Issue:#5915
PiperOrigin-RevId: 249439246
  • Loading branch information
tonihei committed May 23, 2019
1 parent 118218c commit cfefdbc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions RELEASENOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
([#5891](https://github.com/google/ExoPlayer/issues/5891)).
* Add ProgressUpdateListener to PlayerControlView
([#5834](https://github.com/google/ExoPlayer/issues/5834)).
* Prevent unexpected `DownloadHelper.Callback.onPrepared` callbacks after the
preparation of the `DownloadHelper` failed
([#5915](https://github.com/google/ExoPlayer/issues/5915)).

### 2.10.1 ###

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -943,6 +943,7 @@ private boolean handleDownloadHelperCallbackMessage(Message msg) {
downloadHelper.onMediaPrepared();
return true;
case DOWNLOAD_HELPER_CALLBACK_MESSAGE_FAILED:
release();
downloadHelper.onMediaPreparationFailed((IOException) Util.castNonNull(msg.obj));
return true;
default:
Expand Down

0 comments on commit cfefdbc

Please sign in to comment.