style(android): apply ktlint's wrapping to the player sources

scripts/format_native.sh --check reported eight class-signature,
function-signature and wrapping violations. Applies --fix; no behaviour
changes.
This commit is contained in:
edde746
2026-07-26 23:05:17 +02:00
parent a893e1859c
commit fcda012468
3 changed files with 16 additions and 14 deletions
@@ -103,7 +103,9 @@ interface ExoPlayerDelegate : com.edde746.plezy.shared.PlayerDelegate {
internal fun playbackMimeType(isLive: Boolean): String? = if (isLive) MimeTypes.APPLICATION_M3U8 else null
@OptIn(UnstableApi::class)
class ExoPlayerCore(private val activity: Activity) : Player.Listener, SurfacePlayerCore {
class ExoPlayerCore(private val activity: Activity) :
Player.Listener,
SurfacePlayerCore {
companion object {
private const val TAG = "ExoPlayerCore"
@@ -15,27 +15,26 @@ internal object VideoDecoderRecoveryPolicy {
const val MAX_ATTEMPTS_PER_MEDIA = 3
const val HEALTHY_PLAYBACK_PROGRESS_MS = 3000L
fun isTransientVideoDecoderError(errorCode: Int, isVideoRenderer: Boolean): Boolean =
isVideoRenderer &&
(errorCode == PlaybackException.ERROR_CODE_DECODER_INIT_FAILED ||
errorCode == PlaybackException.ERROR_CODE_DECODING_FAILED)
fun isTransientVideoDecoderError(errorCode: Int, isVideoRenderer: Boolean): Boolean = isVideoRenderer &&
(
errorCode == PlaybackException.ERROR_CODE_DECODER_INIT_FAILED ||
errorCode == PlaybackException.ERROR_CODE_DECODING_FAILED
)
fun canRetryRuntimeFailure(
hasRenderedVideoFrame: Boolean,
consecutiveAttempts: Int,
totalAttempts: Int
): Boolean =
hasRenderedVideoFrame &&
consecutiveAttempts < MAX_CONSECUTIVE_ATTEMPTS &&
totalAttempts < MAX_ATTEMPTS_PER_MEDIA
): Boolean = hasRenderedVideoFrame &&
consecutiveAttempts < MAX_CONSECUTIVE_ATTEMPTS &&
totalAttempts < MAX_ATTEMPTS_PER_MEDIA
fun hasSustainedPlayback(
hasRenderedFrame: Boolean,
isPlaying: Boolean,
recoveryPositionMs: Long,
currentPositionMs: Long
): Boolean =
hasRenderedFrame &&
isPlaying &&
currentPositionMs - recoveryPositionMs >= HEALTHY_PLAYBACK_PROGRESS_MS
): Boolean = hasRenderedFrame &&
isPlaying &&
currentPositionMs - recoveryPositionMs >= HEALTHY_PLAYBACK_PROGRESS_MS
}
@@ -41,7 +41,8 @@ class MpvPlayerCore private constructor(
private val audioOnly: Boolean,
private val propertyWriterOverride: (suspend (String, String) -> Unit)?,
initializedForTesting: Boolean
) : SurfaceHolder.Callback, SurfacePlayerCore {
) : SurfaceHolder.Callback,
SurfacePlayerCore {
constructor(context: Context, audioOnly: Boolean = false) : this(context, audioOnly, null, false)
internal constructor(