Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ class Encoder(

companion object {
private val ID = trackMapOf(AtomicInteger(0), AtomicInteger(0))
private const val timeoutUs = 5000L
}

private val type = if (surface != null) TrackType.VIDEO else TrackType.AUDIO
Expand Down Expand Up @@ -110,7 +111,7 @@ class Encoder(
}

override fun drain(): State<WriterData> {
val timeoutUs = if (eosReceivedButNotEnqueued) 5000L else 0L
val timeoutUs = if (eosReceivedButNotEnqueued) 5000L else timeoutUs
return when (val result = codec.dequeueOutputBuffer(info, timeoutUs)) {
INFO_TRY_AGAIN_LATER -> {
if (eosReceivedButNotEnqueued) {
Expand Down