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 authored and ojw28 committed May 31, 2019
1 parent b1ff911 commit cf93b8e
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 @@ -11,6 +11,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 @@ -951,6 +951,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 cf93b8e

Please sign in to comment.