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
1cc62c65
authored
Jun 24, 2021
by
aquilescanta
Committed by
Oliver Woodman
Jun 30, 2021
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Add @ErrorCode to local variables in ExoPlayerImplInternal
PiperOrigin-RevId: 381236418
parent
cca4ac73
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
library/core/src/main/java/com/google/android/exoplayer2/ExoPlayerImplInternal.java
library/core/src/main/java/com/google/android/exoplayer2/ExoPlayerImplInternal.java
View file @
1cc62c65
...
@@ -33,6 +33,7 @@ import androidx.annotation.DoNotInline;
...
@@ -33,6 +33,7 @@ import androidx.annotation.DoNotInline;
import
androidx.annotation.Nullable
;
import
androidx.annotation.Nullable
;
import
androidx.annotation.RequiresApi
;
import
androidx.annotation.RequiresApi
;
import
com.google.android.exoplayer2.DefaultMediaClock.PlaybackParametersListener
;
import
com.google.android.exoplayer2.DefaultMediaClock.PlaybackParametersListener
;
import
com.google.android.exoplayer2.PlaybackException.ErrorCode
;
import
com.google.android.exoplayer2.Player.DiscontinuityReason
;
import
com.google.android.exoplayer2.Player.DiscontinuityReason
;
import
com.google.android.exoplayer2.Player.PlayWhenReadyChangeReason
;
import
com.google.android.exoplayer2.Player.PlayWhenReadyChangeReason
;
import
com.google.android.exoplayer2.Player.PlaybackSuppressionReason
;
import
com.google.android.exoplayer2.Player.PlaybackSuppressionReason
;
...
@@ -581,7 +582,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
...
@@ -581,7 +582,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
}
}
}
catch
(
FileDataSource
.
FileDataSourceException
e
)
{
}
catch
(
FileDataSource
.
FileDataSourceException
e
)
{
@Nullable
Throwable
cause
=
e
.
getCause
();
@Nullable
Throwable
cause
=
e
.
getCause
();
int
errorCode
=
PlaybackException
.
ERROR_CODE_IO_UNSPECIFIED
;
@ErrorCode
int
errorCode
;
if
(
cause
instanceof
FileNotFoundException
)
{
if
(
cause
instanceof
FileNotFoundException
)
{
if
(
Util
.
SDK_INT
>=
21
&&
ErrnoExceptionWrapperV21
.
isPermissionError
(
cause
.
getCause
()))
{
if
(
Util
.
SDK_INT
>=
21
&&
ErrnoExceptionWrapperV21
.
isPermissionError
(
cause
.
getCause
()))
{
errorCode
=
PlaybackException
.
ERROR_CODE_IO_NO_PERMISSION
;
errorCode
=
PlaybackException
.
ERROR_CODE_IO_NO_PERMISSION
;
...
@@ -590,10 +591,12 @@ import java.util.concurrent.atomic.AtomicBoolean;
...
@@ -590,10 +591,12 @@ import java.util.concurrent.atomic.AtomicBoolean;
}
}
}
else
if
(
cause
instanceof
SecurityException
)
{
}
else
if
(
cause
instanceof
SecurityException
)
{
errorCode
=
PlaybackException
.
ERROR_CODE_IO_NO_PERMISSION
;
errorCode
=
PlaybackException
.
ERROR_CODE_IO_NO_PERMISSION
;
}
else
{
errorCode
=
PlaybackException
.
ERROR_CODE_IO_UNSPECIFIED
;
}
}
handleIoException
(
e
,
errorCode
);
handleIoException
(
e
,
errorCode
);
}
catch
(
ParserException
e
)
{
}
catch
(
ParserException
e
)
{
int
errorCode
=
PlaybackException
.
ERROR_CODE_UNSPECIFIED
;
@ErrorCode
int
errorCode
;
if
(
e
.
dataType
==
C
.
DATA_TYPE_MEDIA
)
{
if
(
e
.
dataType
==
C
.
DATA_TYPE_MEDIA
)
{
errorCode
=
errorCode
=
e
.
contentIsMalformed
e
.
contentIsMalformed
...
@@ -604,12 +607,14 @@ import java.util.concurrent.atomic.AtomicBoolean;
...
@@ -604,12 +607,14 @@ import java.util.concurrent.atomic.AtomicBoolean;
e
.
contentIsMalformed
e
.
contentIsMalformed
?
PlaybackException
.
ERROR_CODE_PARSING_MANIFEST_MALFORMED
?
PlaybackException
.
ERROR_CODE_PARSING_MANIFEST_MALFORMED
:
PlaybackException
.
ERROR_CODE_PARSING_MANIFEST_UNSUPPORTED
;
:
PlaybackException
.
ERROR_CODE_PARSING_MANIFEST_UNSUPPORTED
;
}
else
{
errorCode
=
PlaybackException
.
ERROR_CODE_UNSPECIFIED
;
}
}
handleIoException
(
e
,
errorCode
);
handleIoException
(
e
,
errorCode
);
}
catch
(
HttpDataSource
.
InvalidResponseCodeException
e
)
{
}
catch
(
HttpDataSource
.
InvalidResponseCodeException
e
)
{
handleIoException
(
e
,
PlaybackException
.
ERROR_CODE_IO_BAD_HTTP_STATUS
);
handleIoException
(
e
,
PlaybackException
.
ERROR_CODE_IO_BAD_HTTP_STATUS
);
}
catch
(
HttpDataSource
.
HttpDataSourceException
e
)
{
}
catch
(
HttpDataSource
.
HttpDataSourceException
e
)
{
int
errorCode
;
@ErrorCode
int
errorCode
;
if
(
e
.
getCause
()
instanceof
UnknownHostException
)
{
if
(
e
.
getCause
()
instanceof
UnknownHostException
)
{
errorCode
=
PlaybackException
.
ERROR_CODE_IO_DNS_FAILED
;
errorCode
=
PlaybackException
.
ERROR_CODE_IO_DNS_FAILED
;
}
else
{
}
else
{
...
@@ -632,7 +637,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
...
@@ -632,7 +637,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
// Private methods.
// Private methods.
private
void
handleIoException
(
IOException
e
,
@
PlaybackException
.
ErrorCode
int
errorCode
)
{
private
void
handleIoException
(
IOException
e
,
@ErrorCode
int
errorCode
)
{
ExoPlaybackException
error
=
ExoPlaybackException
.
createForSource
(
e
,
errorCode
);
ExoPlaybackException
error
=
ExoPlaybackException
.
createForSource
(
e
,
errorCode
);
@Nullable
MediaPeriodHolder
playingPeriod
=
queue
.
getPlayingPeriod
();
@Nullable
MediaPeriodHolder
playingPeriod
=
queue
.
getPlayingPeriod
();
if
(
playingPeriod
!=
null
)
{
if
(
playingPeriod
!=
null
)
{
...
...
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