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
537e8aad
authored
Apr 27, 2021
by
claincly
Committed by
bachinger
Apr 27, 2021
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Allow the extractor deplete the reordering queue as much as possible.
#minor-release PiperOrigin-RevId: 370673852
parent
26a6aad3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/rtp/RtpExtractor.java
library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/rtp/RtpExtractor.java
View file @
537e8aad
...
@@ -139,8 +139,9 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
...
@@ -139,8 +139,9 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
}
}
long
packetArrivalTimeMs
=
SystemClock
.
elapsedRealtime
();
long
packetArrivalTimeMs
=
SystemClock
.
elapsedRealtime
();
long
packetCutoffTimeMs
=
getCutoffTimeMs
(
packetArrivalTimeMs
);
reorderingQueue
.
offer
(
packet
,
packetArrivalTimeMs
);
reorderingQueue
.
offer
(
packet
,
packetArrivalTimeMs
);
@Nullable
RtpPacket
dequeuedPacket
=
reorderingQueue
.
poll
(
getCutoffTimeMs
(
packetArrivalTimeMs
)
);
@Nullable
RtpPacket
dequeuedPacket
=
reorderingQueue
.
poll
(
packetCutoffTimeMs
);
if
(
dequeuedPacket
==
null
)
{
if
(
dequeuedPacket
==
null
)
{
// No packet is available for reading.
// No packet is available for reading.
return
RESULT_CONTINUE
;
return
RESULT_CONTINUE
;
...
@@ -164,15 +165,20 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
...
@@ -164,15 +165,20 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
// Ignores the incoming packets while seek is pending.
// Ignores the incoming packets while seek is pending.
if
(
isSeekPending
)
{
if
(
isSeekPending
)
{
if
(
nextRtpTimestamp
!=
C
.
TIME_UNSET
&&
playbackStartTimeUs
!=
C
.
TIME_UNSET
)
{
if
(
nextRtpTimestamp
!=
C
.
TIME_UNSET
&&
playbackStartTimeUs
!=
C
.
TIME_UNSET
)
{
reorderingQueue
.
reset
();
payloadReader
.
seek
(
nextRtpTimestamp
,
playbackStartTimeUs
);
payloadReader
.
seek
(
nextRtpTimestamp
,
playbackStartTimeUs
);
isSeekPending
=
false
;
isSeekPending
=
false
;
nextRtpTimestamp
=
C
.
TIME_UNSET
;
nextRtpTimestamp
=
C
.
TIME_UNSET
;
playbackStartTimeUs
=
C
.
TIME_UNSET
;
playbackStartTimeUs
=
C
.
TIME_UNSET
;
}
}
}
else
{
}
else
{
rtpPacketDataBuffer
.
reset
(
packet
.
payloadData
);
do
{
payloadReader
.
consume
(
// Deplete the reordering queue as much as possible.
rtpPacketDataBuffer
,
packet
.
timestamp
,
packet
.
sequenceNumber
,
packet
.
marker
);
rtpPacketDataBuffer
.
reset
(
packet
.
payloadData
);
payloadReader
.
consume
(
rtpPacketDataBuffer
,
packet
.
timestamp
,
packet
.
sequenceNumber
,
packet
.
marker
);
packet
=
reorderingQueue
.
poll
(
packetCutoffTimeMs
);
}
while
(
packet
!=
null
);
}
}
}
}
return
RESULT_CONTINUE
;
return
RESULT_CONTINUE
;
...
...
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