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
4a9ff7b0
authored
Sep 01, 2015
by
Oliver Woodman
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Correctly propagate END_OF_STREAM through Opus decoder.
parent
a953e721
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
extensions/opus/src/main/java/com/google/android/exoplayer/ext/opus/OpusDecoderWrapper.java
extensions/opus/src/main/java/com/google/android/exoplayer/ext/opus/OpusDecoderWrapper.java
View file @
4a9ff7b0
...
@@ -203,6 +203,7 @@ import java.util.LinkedList;
...
@@ -203,6 +203,7 @@ import java.util.LinkedList;
}
}
// Decode.
// Decode.
boolean
skipBuffer
=
false
;
if
(
inputBuffer
.
getFlag
(
FLAG_END_OF_STREAM
))
{
if
(
inputBuffer
.
getFlag
(
FLAG_END_OF_STREAM
))
{
outputBuffer
.
setFlag
(
FLAG_END_OF_STREAM
);
outputBuffer
.
setFlag
(
FLAG_END_OF_STREAM
);
}
else
{
}
else
{
...
@@ -221,13 +222,14 @@ import java.util.LinkedList;
...
@@ -221,13 +222,14 @@ import java.util.LinkedList;
if
(
skipSamples
>
0
)
{
if
(
skipSamples
>
0
)
{
int
bytesPerSample
=
opusHeader
.
channelCount
*
2
;
int
bytesPerSample
=
opusHeader
.
channelCount
*
2
;
int
skipBytes
=
skipSamples
*
bytesPerSample
;
int
skipBytes
=
skipSamples
*
bytesPerSample
;
if
(
outputBuffer
.
size
<
skipBytes
)
{
if
(
outputBuffer
.
size
<
=
skipBytes
)
{
skipSamples
-=
outputBuffer
.
size
/
bytesPerSample
;
skipSamples
-=
outputBuffer
.
size
/
bytesPerSample
;
outputBuffer
.
size
=
0
;
outputBuffer
.
size
=
0
;
skipBuffer
=
true
;
}
else
{
}
else
{
skipSamples
=
0
;
skipSamples
=
0
;
outputBuffer
.
data
.
position
(
skipBytes
);
outputBuffer
.
size
-=
skipBytes
;
outputBuffer
.
size
-=
skipBytes
;
outputBuffer
.
data
.
position
(
skipBytes
);
}
}
}
}
}
}
...
@@ -235,7 +237,7 @@ import java.util.LinkedList;
...
@@ -235,7 +237,7 @@ import java.util.LinkedList;
synchronized
(
lock
)
{
synchronized
(
lock
)
{
if
(
flushDecodedOutputBuffer
if
(
flushDecodedOutputBuffer
||
inputBuffer
.
sampleHolder
.
isDecodeOnly
()
||
inputBuffer
.
sampleHolder
.
isDecodeOnly
()
||
outputBuffer
.
size
==
0
)
{
||
skipBuffer
)
{
// In the following cases, we make the output buffer available again rather than queuing it
// In the following cases, we make the output buffer available again rather than queuing it
// to be consumed:
// to be consumed:
// 1) A flush occured whilst we were decoding.
// 1) A flush occured whilst we were decoding.
...
...
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