fix: 重复导入 + pts 表达式语法修正

This commit is contained in:
2026-05-31 12:47:33 +08:00
parent 6753f12453
commit f635303f2a

View File

@@ -8,7 +8,6 @@ import com.dd.plist.NSDictionary
import com.dd.plist.NSNumber import com.dd.plist.NSNumber
import com.dd.plist.NSString import com.dd.plist.NSString
import com.dd.plist.PropertyListParser import com.dd.plist.PropertyListParser
import com.dd.plist.PropertyListParser
import kotlinx.coroutines.* import kotlinx.coroutines.*
import org.bouncycastle.crypto.generators.Ed25519KeyPairGenerator import org.bouncycastle.crypto.generators.Ed25519KeyPairGenerator
import org.bouncycastle.crypto.params.Ed25519KeyGenerationParameters import org.bouncycastle.crypto.params.Ed25519KeyGenerationParameters
@@ -525,12 +524,14 @@ class AirPlayProtocol(
} }
val isKeyFrame = payloadType == 1 || isKeyFrameNAL(decrypted) 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[8].toInt() and 0xFF).toLong() shl 24) or
((data[9].toInt() and 0xFF).toLong() shl 16) or ((data[9].toInt() and 0xFF).toLong() shl 16) or
((data[10].toInt() and 0xFF).toLong() shl 8) or ((data[10].toInt() and 0xFF).toLong() shl 8) or
(data[11].toInt() and 0xFF).toLong()) (data[11].toInt() and 0xFF).toLong()
} else 0L } else {
0L
}
onVideoData(decrypted, 0, decrypted.size, isKeyFrame, pts * 1000) onVideoData(decrypted, 0, decrypted.size, isKeyFrame, pts * 1000)
} catch (e: Exception) { } catch (e: Exception) {