diff --git a/app/src/main/java/com/qwenpaw/miracast/protocol/airplay/AirPlayProtocol.kt b/app/src/main/java/com/qwenpaw/miracast/protocol/airplay/AirPlayProtocol.kt index 1cb2ea7..681ee72 100644 --- a/app/src/main/java/com/qwenpaw/miracast/protocol/airplay/AirPlayProtocol.kt +++ b/app/src/main/java/com/qwenpaw/miracast/protocol/airplay/AirPlayProtocol.kt @@ -8,7 +8,6 @@ import com.dd.plist.NSDictionary import com.dd.plist.NSNumber import com.dd.plist.NSString import com.dd.plist.PropertyListParser -import com.dd.plist.PropertyListParser import kotlinx.coroutines.* import org.bouncycastle.crypto.generators.Ed25519KeyPairGenerator import org.bouncycastle.crypto.params.Ed25519KeyGenerationParameters @@ -525,12 +524,14 @@ class AirPlayProtocol( } val isKeyFrame = payloadType == 1 || isKeyFrameNAL(decrypted) - val pts = if (data.size >= 12) { + val pts: Long = if (data.size >= 12) { ((data[8].toInt() and 0xFF).toLong() shl 24) or - ((data[9].toInt() and 0xFF).toLong() shl 16) or - ((data[10].toInt() and 0xFF).toLong() shl 8) or - (data[11].toInt() and 0xFF).toLong()) - } else 0L + ((data[9].toInt() and 0xFF).toLong() shl 16) or + ((data[10].toInt() and 0xFF).toLong() shl 8) or + (data[11].toInt() and 0xFF).toLong() + } else { + 0L + } onVideoData(decrypted, 0, decrypted.size, isKeyFrame, pts * 1000) } catch (e: Exception) {