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
193306f2
authored
Jul 22, 2020
by
samrobinson
Committed by
Oliver Woodman
Jul 24, 2020
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Ensure audio renderer exceptions report the correct format.
PiperOrigin-RevId: 322534950
parent
6c837643
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
13 deletions
library/core/src/main/java/com/google/android/exoplayer2/audio/DecoderAudioRenderer.java
library/core/src/main/java/com/google/android/exoplayer2/audio/MediaCodecAudioRenderer.java
library/core/src/main/java/com/google/android/exoplayer2/audio/DecoderAudioRenderer.java
View file @
193306f2
...
...
@@ -255,7 +255,11 @@ public abstract class DecoderAudioRenderer extends BaseRenderer implements Media
// End of stream read having not read a format.
Assertions
.
checkState
(
flagsOnlyBuffer
.
isEndOfStream
());
inputStreamEnded
=
true
;
processEndOfStream
();
try
{
processEndOfStream
();
}
catch
(
AudioSink
.
WriteException
e
)
{
throw
createRendererException
(
e
,
/* format= */
null
);
}
return
;
}
else
{
// We still don't have a format and can't make progress without one.
...
...
@@ -356,7 +360,11 @@ public abstract class DecoderAudioRenderer extends BaseRenderer implements Media
}
else
{
outputBuffer
.
release
();
outputBuffer
=
null
;
processEndOfStream
();
try
{
processEndOfStream
();
}
catch
(
AudioSink
.
WriteException
e
)
{
throw
createRendererException
(
e
,
getOutputFormat
());
}
}
return
false
;
}
...
...
@@ -431,14 +439,9 @@ public abstract class DecoderAudioRenderer extends BaseRenderer implements Media
}
}
private
void
processEndOfStream
()
throws
ExoPlayback
Exception
{
private
void
processEndOfStream
()
throws
AudioSink
.
Write
Exception
{
outputStreamEnded
=
true
;
try
{
audioSink
.
playToEndOfStream
();
}
catch
(
AudioSink
.
WriteException
e
)
{
// TODO(internal: b/145658993) Use outputFormat for the call from drainOutputBuffer.
throw
createRendererException
(
e
,
inputFormat
);
}
audioSink
.
playToEndOfStream
();
}
private
void
flushDecoder
()
throws
ExoPlaybackException
{
...
...
library/core/src/main/java/com/google/android/exoplayer2/audio/MediaCodecAudioRenderer.java
View file @
193306f2
...
...
@@ -634,8 +634,7 @@ public class MediaCodecAudioRenderer extends MediaCodecRenderer implements Media
try
{
fullyConsumed
=
audioSink
.
handleBuffer
(
buffer
,
bufferPresentationTimeUs
,
sampleCount
);
}
catch
(
AudioSink
.
InitializationException
|
AudioSink
.
WriteException
e
)
{
// TODO(internal: b/145658993) Use outputFormat instead.
throw
createRendererException
(
e
,
inputFormat
);
throw
createRendererException
(
e
,
format
);
}
if
(
fullyConsumed
)
{
...
...
@@ -654,8 +653,8 @@ public class MediaCodecAudioRenderer extends MediaCodecRenderer implements Media
try
{
audioSink
.
playToEndOfStream
();
}
catch
(
AudioSink
.
WriteException
e
)
{
// TODO(internal: b/145658993) Use outputFormat instead.
throw
createRendererException
(
e
,
inputFormat
);
Format
outputFormat
=
getCurrentOutputFormat
();
throw
createRendererException
(
e
,
outputFormat
!=
null
?
outputFormat
:
inputFormat
);
}
}
...
...
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