Skip to content

StreamVault is a TV-first free IPTV player for Android TV built with Kotlin, Jetpack Compose, Room, Hilt, and Media3.

Fix FFmpeg verifier and restore build health

David Nashashc35222672d1c
diff --git a/app/src/main/java/com/streamvault/app/ui/screens/player/PlayerContentResolutionSupport.kt b/app/src/main/java/com/streamvault/app/ui/screens/player/PlayerContentResolutionSupport.kt
index 3f6b7dfc..79bdb861 100644
--- a/app/src/main/java/com/streamvault/app/ui/screens/player/PlayerContentResolutionSupport.kt
+++ b/app/src/main/java/com/streamvault/app/ui/screens/player/PlayerContentResolutionSupport.kt
@@ -1,7 +1,7 @@
package com.streamvault.app.ui.screens.player
-import com.streamvault.data.remote.xtream.XtreamStreamUrlResolver
import com.streamvault.data.remote.stalker.StalkerPlaybackResolutionException
+import com.streamvault.data.remote.xtream.XtreamStreamUrlResolver
import com.streamvault.data.security.CredentialDecryptionException
import com.streamvault.domain.model.ContentType
import com.streamvault.domain.model.Episode
@@ -58,55 +58,55 @@ internal fun buildSeriesEpisodeResolution(
currentArtworkUrl
},
resolvedTitle = if (resolvedEpisode != null && currentContentType == ContentType.SERIES_EPISODE) {
+ buildEpisodePlaybackTitle(resolvedEpisode)
+ } else {
+ null
+ },
+ resolvedSeasonNumber = resolvedEpisode?.seasonNumber ?: seasonNumber,
resolvedEpisodeNumber = resolvedEpisode?.episodeNumber ?: episodeNumber
- val streamInfoResult = channelRepository.getStreamInfo(channel)
- if (streamInfoResult.isSuccess) {
- streamInfoResult.getOrNull()?.let { resolved ->
- return PlayerPlaybackStreamResolution(
- streamInfo = resolved.copy(title = resolved.title ?: currentTitle)
- )
- }
- } else {
- // Propagate the underlying error so the caller can show it to the user.
- (streamInfoResult as? Result.Error)?.message?.let { errorMsg ->
- return PlayerPlaybackStreamResolution(
- streamInfo = null,
- resolutionFailureMessage = errorMsg
- )
- }
- }
- }
- }
- }
-
- ContentType.MOVIE -> {
- movieRepository.getMovie(internalContentId)?.let { movie ->
- fallbackStreamId = movie.streamId.takeIf { it > 0L }
- fallbackContainerExtension = movie.containerExtension
- val streamInfoResult = movieRepository.getStreamInfo(movie)
- if (streamInfoResult.isSuccess) {
- streamInfoResult.getOrNull()?.let { resolved ->
+ )
}
internal suspend fun resolvePlayerPlaybackStreamInfo(
logicalUrl: String,
+ internalContentId: Long,
providerId: Long,
+ contentType: ContentType,
currentTitle: String,
currentSeries: Series?,
currentEpisode: Episode?,
channelRepository: ChannelRepository,
movieRepository: MovieRepository,
seriesRepository: SeriesRepository,
+ xtreamStreamUrlResolver: XtreamStreamUrlResolver
): PlayerPlaybackStreamResolution {
var fallbackStreamId: Long? = null
var fallbackContainerExtension: String? = null
+
+ if (providerId > 0L && internalContentId > 0L) {
+ when (contentType) {
+ ContentType.LIVE -> {
+ channelRepository.getChannel(internalContentId)?.let { channel ->
+ fallbackStreamId = channel.streamId.takeIf { it > 0L }
+ ?: channel.epgChannelId?.toLongOrNull()
+ val streamInfoResult = if (shouldUseStoredLiveStreamInfo(logicalUrl, channel.streamUrl)) {
+ channelRepository.getStreamInfo(channel)
+ } else {
+ Result.success(null)
+ }
+ if (streamInfoResult.isSuccess) {
+ streamInfoResult.getOrNull()?.let { resolved ->
+ return PlayerPlaybackStreamResolution(
+ streamInfo = resolved.copy(title = resolved.title ?: currentTitle)
+ )
+ }
+ } else {
+ (streamInfoResult as? Result.Error)?.message?.let { errorMsg ->
return PlayerPlaybackStreamResolution(
streamInfo = null,
resolutionFailureMessage = errorMsg
)
}
-=======
->>>>>>> pr-64-current
}
}
}
@@ -196,7 +196,8 @@ internal suspend fun resolvePlayerPlaybackStreamInfo(
} catch (e: StalkerPlaybackResolutionException) {
return PlayerPlaybackStreamResolution(
streamInfo = null,
- resolutionFailureMessage = e.message ?: "We couldn't resolve a playable Stalker stream for this item."
+ resolutionFailureMessage = e.message
+ ?: "We couldn't resolve a playable Stalker stream for this item."
)
}
diff --git a/app/src/test/java/com/streamvault/app/ui/screens/epg/EpgViewModelTest.kt b/app/src/test/java/com/streamvault/app/ui/screens/epg/EpgViewModelTest.kt
index 4413ff65..c88be51f 100644
--- a/app/src/test/java/com/streamvault/app/ui/screens/epg/EpgViewModelTest.kt
+++ b/app/src/test/java/com/streamvault/app/ui/screens/epg/EpgViewModelTest.kt
@@ -36,6 +36,7 @@ import com.streamvault.domain.usecase.ScheduleRecording
import kotlinx.coroutines.Dispatchers
import javax.inject.Provider as InjectProvider
import kotlinx.coroutines.ExperimentalCoroutinesApi
+import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.flowOf
import kotlinx.coroutines.runBlocking
import kotlinx.coroutines.test.StandardTestDispatcher
@@ -90,6 +91,7 @@ class EpgViewModelTest {
whenever(preferencesRepository.showAllChannelsCategory).thenReturn(flowOf(true))
whenever(combinedM3uRepository.getActiveLiveSource()).thenReturn(flowOf(null))
whenever(preferencesRepository.guideDefaultCategoryId).thenReturn(flowOf(null))
+ whenever(livePreviewHandoffManager.reverseSessionFlow).thenReturn(MutableStateFlow(null))
runBlocking {
whenever(epgRepository.getResolvedProgramsForChannels(any(), any(), any(), any())).thenReturn(emptyMap())
whenever(epgRepository.getProgramsForChannelsSnapshot(any(), any(), any(), any())).thenReturn(emptyMap())
diff --git a/app/src/test/java/com/streamvault/app/ui/screens/home/HomeViewModelTest.kt b/app/src/test/java/com/streamvault/app/ui/screens/home/HomeViewModelTest.kt
index e0079027..1755ab65 100644
--- a/app/src/test/java/com/streamvault/app/ui/screens/home/HomeViewModelTest.kt
+++ b/app/src/test/java/com/streamvault/app/ui/screens/home/HomeViewModelTest.kt
@@ -28,6 +28,7 @@ import com.streamvault.domain.usecase.UnlockParentalCategory
import com.streamvault.player.PlayerEngine
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.ExperimentalCoroutinesApi
+import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.flowOf
import kotlinx.coroutines.launch
import kotlinx.coroutines.test.*
@@ -77,6 +78,7 @@ class HomeViewModelTest {
whenever(providerRepository.getActiveProvider()).thenReturn(flowOf(null))
whenever(combinedM3uRepository.getActiveLiveSource()).thenReturn(flowOf(null))
whenever(combinedM3uRepository.getActiveLiveSourceOptions()).thenReturn(flowOf(emptyList()))
+ whenever(livePreviewHandoffManager.reverseSessionFlow).thenReturn(MutableStateFlow(null))
whenever(preferencesRepository.parentalControlLevel).thenReturn(flowOf(0))
whenever(favoriteRepository.getFavorites(any<Long>(), eq(ContentType.LIVE))).thenReturn(flowOf(emptyList()))
whenever(favoriteRepository.getFavorites(any<List<Long>>(), eq(ContentType.LIVE))).thenReturn(flowOf(emptyList()))
diff --git a/data/src/test/java/com/streamvault/data/repository/EpgRepositoryImplTest.kt b/data/src/test/java/com/streamvault/data/repository/EpgRepositoryImplTest.kt
index ca90e83d..f7af912f 100644
--- a/data/src/test/java/com/streamvault/data/repository/EpgRepositoryImplTest.kt
+++ b/data/src/test/java/com/streamvault/data/repository/EpgRepositoryImplTest.kt
@@ -67,6 +67,7 @@ class EpgRepositoryImplTest {
runBlocking {
whenever(providerDao.getById(any())).thenReturn(null)
whenever(preferencesRepository.getEpgTimeShiftMinutes(any())).thenReturn(0)
+ whenever(preferencesRepository.epgTimeShiftMinutes(any())).thenReturn(flowOf(0))
}
}
diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md
index 80dd1cab..b2b4d33d 100644
--- a/docs/CHANGELOG.md
+++ b/docs/CHANGELOG.md
@@ -17,9 +17,12 @@ All notable product changes are recorded in this document.
### Fixed
+- Fixed the bundled FFmpeg Media3 artifact so MPEG Layer II audio (`audio/mpeg-L2`) maps to the bundled `mp2` decoder and release builds pass FFmpeg verification again.
+- Fixed a broken player content-resolution merge that could leave the app failing to compile.
- Fixed player stream-info failures to preserve and surface the underlying error message instead of dropping it.
- Fixed decoder error recovery to retry against alternate stream formats when available.
- Fixed XMLTV parsing for ISO timestamps that include timezone offsets.
+- Fixed EPG repository test setup so reactive time-shift lookups are stubbed correctly during build verification.
- Fixed completed local download playback so `content://`/`file://` files do not consume the provider download lease and do not pause active downloads.
- Fixed failed download Resume to clear partial output and restart through the scheduler.
- Fixed provider playback interruptions leaving downloads stuck in `DOWNLOADING` by cancelling the active OkHttp call and resetting the partial row to zero-byte `PAUSED` state.
diff --git a/player/libs/media3-decoder-ffmpeg-1.9.2.aar b/player/libs/media3-decoder-ffmpeg-1.9.2.aar
index f0486fa5..765be494 100644
Binary files a/player/libs/media3-decoder-ffmpeg-1.9.2.aar and b/player/libs/media3-decoder-ffmpeg-1.9.2.aar differ
diff --git a/player/src/main/java/com/streamvault/player/playback/PlayerRetryPolicy.kt b/player/src/main/java/com/streamvault/player/playback/PlayerRetryPolicy.kt
index b931cf3f..f6add38b 100644
--- a/player/src/main/java/com/streamvault/player/playback/PlayerRetryPolicy.kt
+++ b/player/src/main/java/com/streamvault/player/playback/PlayerRetryPolicy.kt
@@ -70,7 +70,9 @@ class PlayerRetryPolicy(
PlaybackErrorCategory.LIVE_WINDOW -> true
PlaybackErrorCategory.NETWORK,
PlaybackErrorCategory.HTTP_SERVER,
+ PlaybackErrorCategory.EMPTY_RESPONSE,
PlaybackErrorCategory.UNKNOWN -> streamContext.isLive
+ PlaybackErrorCategory.PROVIDER_LIMIT -> false
PlaybackErrorCategory.SOURCE_MALFORMED -> streamContext.resolvedStreamType == ResolvedStreamType.HLS
PlaybackErrorCategory.HTTP_AUTH,
PlaybackErrorCategory.SSL,