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
29eeff9f
authored
Jun 04, 2021
by
aquilescanta
Committed by
bachinger
Jun 08, 2021
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Assign error codes to FileDataSourceExceptions
PiperOrigin-RevId: 377481210
parent
536f7c8d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
2 deletions
library/core/src/main/java/com/google/android/exoplayer2/ExoPlayerImplInternal.java
library/core/src/main/java/com/google/android/exoplayer2/upstream/FileDataSource.java
library/core/src/main/java/com/google/android/exoplayer2/ExoPlayerImplInternal.java
View file @
29eeff9f
...
@@ -46,6 +46,7 @@ import com.google.android.exoplayer2.trackselection.ExoTrackSelection;
...
@@ -46,6 +46,7 @@ import com.google.android.exoplayer2.trackselection.ExoTrackSelection;
import
com.google.android.exoplayer2.trackselection.TrackSelector
;
import
com.google.android.exoplayer2.trackselection.TrackSelector
;
import
com.google.android.exoplayer2.trackselection.TrackSelectorResult
;
import
com.google.android.exoplayer2.trackselection.TrackSelectorResult
;
import
com.google.android.exoplayer2.upstream.BandwidthMeter
;
import
com.google.android.exoplayer2.upstream.BandwidthMeter
;
import
com.google.android.exoplayer2.upstream.FileDataSource
;
import
com.google.android.exoplayer2.upstream.HttpDataSource
;
import
com.google.android.exoplayer2.upstream.HttpDataSource
;
import
com.google.android.exoplayer2.util.Assertions
;
import
com.google.android.exoplayer2.util.Assertions
;
import
com.google.android.exoplayer2.util.Clock
;
import
com.google.android.exoplayer2.util.Clock
;
...
@@ -55,6 +56,7 @@ import com.google.android.exoplayer2.util.TraceUtil;
...
@@ -55,6 +56,7 @@ import com.google.android.exoplayer2.util.TraceUtil;
import
com.google.android.exoplayer2.util.Util
;
import
com.google.android.exoplayer2.util.Util
;
import
com.google.common.base.Supplier
;
import
com.google.common.base.Supplier
;
import
com.google.common.collect.ImmutableList
;
import
com.google.common.collect.ImmutableList
;
import
java.io.FileNotFoundException
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.Collections
;
...
@@ -572,6 +574,15 @@ import java.util.concurrent.atomic.AtomicBoolean;
...
@@ -572,6 +574,15 @@ import java.util.concurrent.atomic.AtomicBoolean;
stopInternal
(
/* forceResetRenderers= */
true
,
/* acknowledgeStop= */
false
);
stopInternal
(
/* forceResetRenderers= */
true
,
/* acknowledgeStop= */
false
);
playbackInfo
=
playbackInfo
.
copyWithPlaybackError
(
e
);
playbackInfo
=
playbackInfo
.
copyWithPlaybackError
(
e
);
}
}
}
catch
(
FileDataSource
.
FileDataSourceException
e
)
{
@Nullable
Throwable
cause
=
e
.
getCause
();
int
errorCode
=
PlaybackException
.
ERROR_CODE_IO_UNSPECIFIED
;
if
(
cause
instanceof
FileNotFoundException
)
{
errorCode
=
PlaybackException
.
ERROR_CODE_IO_FILE_NOT_FOUND
;
}
else
if
(
cause
instanceof
SecurityException
)
{
errorCode
=
PlaybackException
.
ERROR_CODE_IO_NO_PERMISSION
;
}
handleIoException
(
e
,
errorCode
);
}
catch
(
ParserException
e
)
{
}
catch
(
ParserException
e
)
{
int
errorCode
=
PlaybackException
.
ERROR_CODE_UNSPECIFIED
;
int
errorCode
=
PlaybackException
.
ERROR_CODE_UNSPECIFIED
;
if
(
e
.
dataType
==
C
.
DATA_TYPE_MEDIA
)
{
if
(
e
.
dataType
==
C
.
DATA_TYPE_MEDIA
)
{
...
...
library/core/src/main/java/com/google/android/exoplayer2/upstream/FileDataSource.java
View file @
29eeff9f
...
@@ -33,7 +33,7 @@ public final class FileDataSource extends BaseDataSource {
...
@@ -33,7 +33,7 @@ public final class FileDataSource extends BaseDataSource {
/** Thrown when a {@link FileDataSource} encounters an error reading a file. */
/** Thrown when a {@link FileDataSource} encounters an error reading a file. */
public
static
class
FileDataSourceException
extends
IOException
{
public
static
class
FileDataSourceException
extends
IOException
{
public
FileDataSourceException
(
IO
Exception
cause
)
{
public
FileDataSourceException
(
Exception
cause
)
{
super
(
cause
);
super
(
cause
);
}
}
...
@@ -94,7 +94,7 @@ public final class FileDataSource extends BaseDataSource {
...
@@ -94,7 +94,7 @@ public final class FileDataSource extends BaseDataSource {
}
}
}
catch
(
FileDataSourceException
e
)
{
}
catch
(
FileDataSourceException
e
)
{
throw
e
;
throw
e
;
}
catch
(
IO
Exception
e
)
{
}
catch
(
Exception
e
)
{
throw
new
FileDataSourceException
(
e
);
throw
new
FileDataSourceException
(
e
);
}
}
...
...
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