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
424b29f9
authored
Jan 27, 2015
by
Martin Bonnin
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
remove REINIT_STATE_DO_REINIT_NOW state, reinit directly when needed.
parent
79708f43
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
13 deletions
library/src/main/java/com/google/android/exoplayer/MediaCodecTrackRenderer.java
library/src/main/java/com/google/android/exoplayer/MediaCodecTrackRenderer.java
View file @
424b29f9
...
@@ -148,11 +148,6 @@ public abstract class MediaCodecTrackRenderer extends TrackRenderer {
...
@@ -148,11 +148,6 @@ public abstract class MediaCodecTrackRenderer extends TrackRenderer {
* The end of stream has been sent, wait for the codec to acknowledge it.
* The end of stream has been sent, wait for the codec to acknowledge it.
*/
*/
private
static
final
int
REINIT_STATE_WAIT_END_OF_STREAM
=
2
;
private
static
final
int
REINIT_STATE_WAIT_END_OF_STREAM
=
2
;
/**
* The last sample has been processed, we can safely reinit now.
*/
private
static
final
int
REINIT_STATE_DO_REINIT_NOW
=
3
;
public
final
CodecCounters
codecCounters
;
public
final
CodecCounters
codecCounters
;
...
@@ -521,12 +516,6 @@ public abstract class MediaCodecTrackRenderer extends TrackRenderer {
...
@@ -521,12 +516,6 @@ public abstract class MediaCodecTrackRenderer extends TrackRenderer {
return
false
;
return
false
;
}
}
if
(
codecReinitState
==
REINIT_STATE_DO_REINIT_NOW
)
{
releaseCodec
();
maybeInitCodec
();
return
false
;
}
if
(
inputIndex
<
0
)
{
if
(
inputIndex
<
0
)
{
inputIndex
=
codec
.
dequeueInputBuffer
(
0
);
inputIndex
=
codec
.
dequeueInputBuffer
(
0
);
if
(
inputIndex
<
0
)
{
if
(
inputIndex
<
0
)
{
...
@@ -691,7 +680,8 @@ public abstract class MediaCodecTrackRenderer extends TrackRenderer {
...
@@ -691,7 +680,8 @@ public abstract class MediaCodecTrackRenderer extends TrackRenderer {
}
else
{
}
else
{
if
(!
hasQueuedOneInputBuffer
)
{
if
(!
hasQueuedOneInputBuffer
)
{
// no need to signal end of stream if nothing has been queued, we can just reinit asap
// no need to signal end of stream if nothing has been queued, we can just reinit asap
codecReinitState
=
REINIT_STATE_DO_REINIT_NOW
;
releaseCodec
();
maybeInitCodec
();
}
else
{
}
else
{
codecReinitState
=
REINIT_STATE_SIGNAL_END_OF_STREAM
;
codecReinitState
=
REINIT_STATE_SIGNAL_END_OF_STREAM
;
}
}
...
@@ -783,7 +773,9 @@ public abstract class MediaCodecTrackRenderer extends TrackRenderer {
...
@@ -783,7 +773,9 @@ public abstract class MediaCodecTrackRenderer extends TrackRenderer {
if
((
outputBufferInfo
.
flags
&
MediaCodec
.
BUFFER_FLAG_END_OF_STREAM
)
!=
0
)
{
if
((
outputBufferInfo
.
flags
&
MediaCodec
.
BUFFER_FLAG_END_OF_STREAM
)
!=
0
)
{
if
(
codecReinitState
==
REINIT_STATE_WAIT_END_OF_STREAM
)
{
if
(
codecReinitState
==
REINIT_STATE_WAIT_END_OF_STREAM
)
{
codecReinitState
=
REINIT_STATE_DO_REINIT_NOW
;
// The last sample has been processed, we can safely reinit now
releaseCodec
();
maybeInitCodec
();
}
else
{
}
else
{
outputStreamEnded
=
true
;
outputStreamEnded
=
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