mirror of
https://gitlab.futo.org/videostreaming/grayjay.git
synced 2025-09-02 15:46:45 +00:00
Crashfix.
This commit is contained in:
parent
e047ab5684
commit
766f57dc9d
2 changed files with 22 additions and 4 deletions
|
@ -45,6 +45,8 @@ import com.futo.platformplayer.logging.Logger
|
||||||
import com.futo.platformplayer.models.CastingDeviceInfo
|
import com.futo.platformplayer.models.CastingDeviceInfo
|
||||||
import com.futo.platformplayer.parsers.HLS
|
import com.futo.platformplayer.parsers.HLS
|
||||||
import com.futo.platformplayer.states.StateApp
|
import com.futo.platformplayer.states.StateApp
|
||||||
|
import com.futo.platformplayer.states.StateSync
|
||||||
|
import com.futo.platformplayer.states.StateSync.Companion
|
||||||
import com.futo.platformplayer.stores.CastingDeviceInfoStorage
|
import com.futo.platformplayer.stores.CastingDeviceInfoStorage
|
||||||
import com.futo.platformplayer.stores.FragmentedStorage
|
import com.futo.platformplayer.stores.FragmentedStorage
|
||||||
import com.futo.platformplayer.toUrlAddress
|
import com.futo.platformplayer.toUrlAddress
|
||||||
|
@ -228,12 +230,20 @@ class StateCasting {
|
||||||
|
|
||||||
override fun onStartDiscoveryFailed(serviceType: String, errorCode: Int) {
|
override fun onStartDiscoveryFailed(serviceType: String, errorCode: Int) {
|
||||||
Log.e(TAG, "Discovery failed for $serviceType: Error code:$errorCode")
|
Log.e(TAG, "Discovery failed for $serviceType: Error code:$errorCode")
|
||||||
_nsdManager?.stopServiceDiscovery(this)
|
try {
|
||||||
|
_nsdManager?.stopServiceDiscovery(this)
|
||||||
|
} catch (e: Throwable) {
|
||||||
|
Logger.w(TAG, "Failed to stop service discovery", e)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onStopDiscoveryFailed(serviceType: String, errorCode: Int) {
|
override fun onStopDiscoveryFailed(serviceType: String, errorCode: Int) {
|
||||||
Log.e(TAG, "Stop discovery failed for $serviceType: Error code:$errorCode")
|
Log.e(TAG, "Stop discovery failed for $serviceType: Error code:$errorCode")
|
||||||
_nsdManager?.stopServiceDiscovery(this)
|
try {
|
||||||
|
_nsdManager?.stopServiceDiscovery(this)
|
||||||
|
} catch (e: Throwable) {
|
||||||
|
Logger.w(TAG, "Failed to stop service discovery", e)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onServiceFound(service: NsdServiceInfo) {
|
override fun onServiceFound(service: NsdServiceInfo) {
|
||||||
|
|
|
@ -148,12 +148,20 @@ class StateSync {
|
||||||
|
|
||||||
override fun onStartDiscoveryFailed(serviceType: String, errorCode: Int) {
|
override fun onStartDiscoveryFailed(serviceType: String, errorCode: Int) {
|
||||||
Log.e(TAG, "Discovery failed for $serviceType: Error code:$errorCode")
|
Log.e(TAG, "Discovery failed for $serviceType: Error code:$errorCode")
|
||||||
_nsdManager?.stopServiceDiscovery(this)
|
try {
|
||||||
|
_nsdManager?.stopServiceDiscovery(this)
|
||||||
|
} catch (e: Throwable) {
|
||||||
|
Logger.w(TAG, "Failed to stop service discovery", e)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onStopDiscoveryFailed(serviceType: String, errorCode: Int) {
|
override fun onStopDiscoveryFailed(serviceType: String, errorCode: Int) {
|
||||||
Log.e(TAG, "Stop discovery failed for $serviceType: Error code:$errorCode")
|
Log.e(TAG, "Stop discovery failed for $serviceType: Error code:$errorCode")
|
||||||
_nsdManager?.stopServiceDiscovery(this)
|
try {
|
||||||
|
_nsdManager?.stopServiceDiscovery(this)
|
||||||
|
} catch (e: Throwable) {
|
||||||
|
Logger.w(TAG, "Failed to stop service discovery", e)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun addOrUpdate(name: String, adrs: Array<InetAddress>, port: Int, attributes: Map<String, ByteArray>) {
|
fun addOrUpdate(name: String, adrs: Array<InetAddress>, port: Int, attributes: Map<String, ByteArray>) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue