Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
SDK
/
exoplayer
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
0df62a4f
authored
Jul 27, 2021
by
aquilescanta
Committed by
bachinger
Jul 27, 2021
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Add ERROR_CODE_FAILED_RUNTIME_CHECK for failed checks
PiperOrigin-RevId: 387143625
parent
f9d94204
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
3 deletions
extensions/cronet/src/main/java/com/google/android/exoplayer2/ext/cronet/CronetDataSource.java
extensions/okhttp/src/main/java/com/google/android/exoplayer2/ext/okhttp/OkHttpDataSource.java
library/common/src/main/java/com/google/android/exoplayer2/PlaybackException.java
library/core/src/main/java/com/google/android/exoplayer2/ExoPlayerImplInternal.java
extensions/cronet/src/main/java/com/google/android/exoplayer2/ext/cronet/CronetDataSource.java
View file @
0df62a4f
...
@@ -937,7 +937,7 @@ public class CronetDataSource extends BaseDataSource implements HttpDataSource {
...
@@ -937,7 +937,7 @@ public class CronetDataSource extends BaseDataSource implements HttpDataSource {
throw
new
OpenException
(
throw
new
OpenException
(
"HTTP request with non-empty body must set Content-Type"
,
"HTTP request with non-empty body must set Content-Type"
,
dataSpec
,
dataSpec
,
PlaybackException
.
ERROR_CODE_
IO_BAD_HTTP_REQUEST
,
PlaybackException
.
ERROR_CODE_
FAILED_RUNTIME_CHECK
,
Status
.
IDLE
);
Status
.
IDLE
);
}
}
...
...
extensions/okhttp/src/main/java/com/google/android/exoplayer2/ext/okhttp/OkHttpDataSource.java
View file @
0df62a4f
...
@@ -405,7 +405,7 @@ public class OkHttpDataSource extends BaseDataSource implements HttpDataSource {
...
@@ -405,7 +405,7 @@ public class OkHttpDataSource extends BaseDataSource implements HttpDataSource {
throw
new
HttpDataSourceException
(
throw
new
HttpDataSourceException
(
"Malformed URL"
,
"Malformed URL"
,
dataSpec
,
dataSpec
,
PlaybackException
.
ERROR_CODE_
IO_BAD_HTTP_REQUEST
,
PlaybackException
.
ERROR_CODE_
FAILED_RUNTIME_CHECK
,
HttpDataSourceException
.
TYPE_OPEN
);
HttpDataSourceException
.
TYPE_OPEN
);
}
}
...
...
library/common/src/main/java/com/google/android/exoplayer2/PlaybackException.java
View file @
0df62a4f
...
@@ -46,6 +46,7 @@ public class PlaybackException extends Exception implements Bundleable {
...
@@ -46,6 +46,7 @@ public class PlaybackException extends Exception implements Bundleable {
ERROR_CODE_REMOTE_ERROR
,
ERROR_CODE_REMOTE_ERROR
,
ERROR_CODE_BEHIND_LIVE_WINDOW
,
ERROR_CODE_BEHIND_LIVE_WINDOW
,
ERROR_CODE_TIMEOUT
,
ERROR_CODE_TIMEOUT
,
ERROR_CODE_FAILED_RUNTIME_CHECK
,
ERROR_CODE_IO_UNSPECIFIED
,
ERROR_CODE_IO_UNSPECIFIED
,
ERROR_CODE_IO_NETWORK_UNAVAILABLE
,
ERROR_CODE_IO_NETWORK_UNAVAILABLE
,
ERROR_CODE_IO_NETWORK_CONNECTION_FAILED
,
ERROR_CODE_IO_NETWORK_CONNECTION_FAILED
,
...
@@ -94,6 +95,13 @@ public class PlaybackException extends Exception implements Bundleable {
...
@@ -94,6 +95,13 @@ public class PlaybackException extends Exception implements Bundleable {
public
static
final
int
ERROR_CODE_BEHIND_LIVE_WINDOW
=
1002
;
public
static
final
int
ERROR_CODE_BEHIND_LIVE_WINDOW
=
1002
;
/** Caused by a generic timeout. */
/** Caused by a generic timeout. */
public
static
final
int
ERROR_CODE_TIMEOUT
=
1003
;
public
static
final
int
ERROR_CODE_TIMEOUT
=
1003
;
/**
* Caused by a failed runtime check.
*
* <p>This can happen when the application fails to comply with the player's API requirements (for
* example, by passing invalid arguments), or when the player reaches an invalid state.
*/
public
static
final
int
ERROR_CODE_FAILED_RUNTIME_CHECK
=
1004
;
// Input/Output errors (2xxx).
// Input/Output errors (2xxx).
...
@@ -217,6 +225,8 @@ public class PlaybackException extends Exception implements Bundleable {
...
@@ -217,6 +225,8 @@ public class PlaybackException extends Exception implements Bundleable {
return
"ERROR_CODE_BEHIND_LIVE_WINDOW"
;
return
"ERROR_CODE_BEHIND_LIVE_WINDOW"
;
case
ERROR_CODE_TIMEOUT:
case
ERROR_CODE_TIMEOUT:
return
"ERROR_CODE_TIMEOUT"
;
return
"ERROR_CODE_TIMEOUT"
;
case
ERROR_CODE_FAILED_RUNTIME_CHECK:
return
"ERROR_CODE_FAILED_RUNTIME_CHECK"
;
case
ERROR_CODE_IO_UNSPECIFIED:
case
ERROR_CODE_IO_UNSPECIFIED:
return
"ERROR_CODE_IO_UNSPECIFIED"
;
return
"ERROR_CODE_IO_UNSPECIFIED"
;
case
ERROR_CODE_IO_NETWORK_UNAVAILABLE:
case
ERROR_CODE_IO_NETWORK_UNAVAILABLE:
...
...
library/core/src/main/java/com/google/android/exoplayer2/ExoPlayerImplInternal.java
View file @
0df62a4f
...
@@ -599,7 +599,13 @@ import java.util.concurrent.atomic.AtomicBoolean;
...
@@ -599,7 +599,13 @@ import java.util.concurrent.atomic.AtomicBoolean;
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
handleIoException
(
e
,
PlaybackException
.
ERROR_CODE_IO_UNSPECIFIED
);
handleIoException
(
e
,
PlaybackException
.
ERROR_CODE_IO_UNSPECIFIED
);
}
catch
(
RuntimeException
e
)
{
}
catch
(
RuntimeException
e
)
{
ExoPlaybackException
error
=
ExoPlaybackException
.
createForUnexpected
(
e
);
@ErrorCode
int
errorCode
;
if
(
e
instanceof
IllegalStateException
||
e
instanceof
IllegalArgumentException
)
{
errorCode
=
PlaybackException
.
ERROR_CODE_FAILED_RUNTIME_CHECK
;
}
else
{
errorCode
=
PlaybackException
.
ERROR_CODE_UNSPECIFIED
;
}
ExoPlaybackException
error
=
ExoPlaybackException
.
createForUnexpected
(
e
,
errorCode
);
Log
.
e
(
TAG
,
"Playback error"
,
error
);
Log
.
e
(
TAG
,
"Playback error"
,
error
);
stopInternal
(
/* forceResetRenderers= */
true
,
/* acknowledgeStop= */
false
);
stopInternal
(
/* forceResetRenderers= */
true
,
/* acknowledgeStop= */
false
);
playbackInfo
=
playbackInfo
.
copyWithPlaybackError
(
error
);
playbackInfo
=
playbackInfo
.
copyWithPlaybackError
(
error
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment