mirror of
https://gitlab.futo.org/videostreaming/grayjay.git
synced 2025-09-26 11:19:05 +00:00
Merge branch 'master' of gitlab.futo.org:videostreaming/grayjay
This commit is contained in:
commit
db8426779c
2 changed files with 10 additions and 6 deletions
|
@ -29,7 +29,7 @@ data class ImageVariable(
|
||||||
Glide.with(imageView)
|
Glide.with(imageView)
|
||||||
.load(bitmap)
|
.load(bitmap)
|
||||||
.into(imageView)
|
.into(imageView)
|
||||||
} else if(resId != null) {
|
} else if(resId != null && resId > 0) {
|
||||||
Glide.with(imageView)
|
Glide.with(imageView)
|
||||||
.load(resId)
|
.load(resId)
|
||||||
.into(imageView)
|
.into(imageView)
|
||||||
|
|
|
@ -3,6 +3,7 @@ package com.futo.platformplayer.sync.internal
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
import com.futo.platformplayer.LittleEndianDataInputStream
|
import com.futo.platformplayer.LittleEndianDataInputStream
|
||||||
import com.futo.platformplayer.LittleEndianDataOutputStream
|
import com.futo.platformplayer.LittleEndianDataOutputStream
|
||||||
|
import com.futo.platformplayer.copyToOutputStream
|
||||||
import com.futo.platformplayer.ensureNotMainThread
|
import com.futo.platformplayer.ensureNotMainThread
|
||||||
import com.futo.platformplayer.logging.Logger
|
import com.futo.platformplayer.logging.Logger
|
||||||
import com.futo.platformplayer.noise.protocol.CipherStatePair
|
import com.futo.platformplayer.noise.protocol.CipherStatePair
|
||||||
|
@ -11,6 +12,7 @@ import com.futo.platformplayer.noise.protocol.HandshakeState
|
||||||
import com.futo.platformplayer.states.StateSync
|
import com.futo.platformplayer.states.StateSync
|
||||||
import com.futo.platformplayer.sync.internal.ChannelRelayed.Companion
|
import com.futo.platformplayer.sync.internal.ChannelRelayed.Companion
|
||||||
import kotlinx.coroutines.CompletableDeferred
|
import kotlinx.coroutines.CompletableDeferred
|
||||||
|
import java.io.ByteArrayInputStream
|
||||||
import java.io.ByteArrayOutputStream
|
import java.io.ByteArrayOutputStream
|
||||||
import java.io.InputStream
|
import java.io.InputStream
|
||||||
import java.io.OutputStream
|
import java.io.OutputStream
|
||||||
|
@ -24,6 +26,7 @@ import java.nio.ByteOrder
|
||||||
import java.util.Base64
|
import java.util.Base64
|
||||||
import java.util.Locale
|
import java.util.Locale
|
||||||
import java.util.concurrent.ConcurrentHashMap
|
import java.util.concurrent.ConcurrentHashMap
|
||||||
|
import java.util.zip.GZIPInputStream
|
||||||
import java.util.zip.GZIPOutputStream
|
import java.util.zip.GZIPOutputStream
|
||||||
import kotlin.math.min
|
import kotlin.math.min
|
||||||
import kotlin.system.measureTimeMillis
|
import kotlin.system.measureTimeMillis
|
||||||
|
@ -837,12 +840,13 @@ class SyncSocketSession {
|
||||||
if (!isGzipSupported)
|
if (!isGzipSupported)
|
||||||
throw Exception("Failed to handle packet, gzip is not supported for this opcode (opcode = ${opcode}, subOpcode = ${subOpcode}, data.length = ${data.remaining()}).")
|
throw Exception("Failed to handle packet, gzip is not supported for this opcode (opcode = ${opcode}, subOpcode = ${subOpcode}, data.length = ${data.remaining()}).")
|
||||||
|
|
||||||
val compressedStream = ByteArrayOutputStream()
|
val compressedStream = ByteArrayInputStream(data.array(), data.position(), data.remaining());
|
||||||
GZIPOutputStream(compressedStream).use { gzipStream ->
|
var outputStream = ByteArrayOutputStream();
|
||||||
gzipStream.write(data.array(), data.position(), data.remaining())
|
GZIPInputStream(compressedStream).use { gzipStream ->
|
||||||
gzipStream.finish()
|
gzipStream.copyToOutputStream(outputStream);
|
||||||
|
gzipStream.close();
|
||||||
}
|
}
|
||||||
data = ByteBuffer.wrap(compressedStream.toByteArray())
|
data = ByteBuffer.wrap(outputStream.toByteArray())
|
||||||
}
|
}
|
||||||
|
|
||||||
when (opcode) {
|
when (opcode) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue