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
b88012f5
authored
Jun 26, 2015
by
Oliver Woodman
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Process final output buffer if it's non-empty.
Issue: #417
parent
a175ecbf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
12 deletions
library/src/main/java/com/google/android/exoplayer/MediaCodecTrackRenderer.java
library/src/main/java/com/google/android/exoplayer/MediaCodecTrackRenderer.java
View file @
b88012f5
...
...
@@ -835,23 +835,32 @@ public abstract class MediaCodecTrackRenderer extends TrackRenderer {
return
false
;
}
if
((
outputBufferInfo
.
flags
&
MediaCodec
.
BUFFER_FLAG_END_OF_STREAM
)
!=
0
)
{
if
(
codecReinitializationState
==
REINITIALIZATION_STATE_WAIT_END_OF_STREAM
)
{
// We're waiting to re-initialize the codec, and have now received all final output buffers.
releaseCodec
();
maybeInitCodec
();
}
else
{
outputStreamEnded
=
true
;
}
return
false
;
int
decodeOnlyIndex
=
getDecodeOnlyIndex
(
outputBufferInfo
.
presentationTimeUs
);
boolean
isEndOfStream
=
(
outputBufferInfo
.
flags
&
MediaCodec
.
BUFFER_FLAG_END_OF_STREAM
)
!=
0
;
boolean
processedOutputBuffer
;
if
(
isEndOfStream
&&
outputBufferInfo
.
size
==
0
)
{
// Empty buffer indicating the end of the stream.
codec
.
releaseOutputBuffer
(
outputIndex
,
false
);
processedOutputBuffer
=
true
;
}
else
{
processedOutputBuffer
=
processOutputBuffer
(
positionUs
,
elapsedRealtimeUs
,
codec
,
outputBuffers
[
outputIndex
],
outputBufferInfo
,
outputIndex
,
decodeOnlyIndex
!=
-
1
);
}
int
decodeOnlyIndex
=
getDecodeOnlyIndex
(
outputBufferInfo
.
presentationTimeUs
);
if
(
processOutputBuffer
(
positionUs
,
elapsedRealtimeUs
,
codec
,
outputBuffers
[
outputIndex
],
outputBufferInfo
,
outputIndex
,
decodeOnlyIndex
!=
-
1
))
{
if
(
processedOutputBuffer
)
{
if
(
decodeOnlyIndex
!=
-
1
)
{
decodeOnlyPresentationTimestamps
.
remove
(
decodeOnlyIndex
);
}
if
(
isEndOfStream
)
{
if
(
codecReinitializationState
==
REINITIALIZATION_STATE_WAIT_END_OF_STREAM
)
{
// We're waiting to re-initialize the codec, and have now processed all final buffers.
releaseCodec
();
maybeInitCodec
();
}
else
{
outputStreamEnded
=
true
;
}
}
outputIndex
=
-
1
;
return
true
;
}
...
...
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