Show and label WebDAV/SMB video streams in the quality selector

Media-source streams from WebDAV/SMB were invisible in the Video list:
the filter required remote URLs to carry a resolution, which
MediaFile.toStream never sets. Include non-adaptive remote streams
without resolution (only media sources produce those), extend the
mpv-track display enrichment to the currently playing stream regardless
of URL scheme, and classify metadata-less streams as recommended — a
nil codec previously counted as software-decoded, hiding the row behind
advanced mode with a spurious warning. The warning now uses the
enriched codec.
This commit is contained in:
Arkadiusz Fal
2026-07-30 23:58:05 +02:00
parent 9e546e29ee
commit 6a0fe2fbbf
2 changed files with 30 additions and 11 deletions

View File

@@ -35,8 +35,17 @@ extension QualitySelectorView {
var videoStreams: [Stream] {
let maxRes: StreamResolution? = preferredQuality.maxResolution
// Separate downloaded streams (always include them, shown first)
let downloadedStreams: [Stream] = streams.filter { $0.url.isFileURL && !$0.isAudioOnly }
// Separate downloaded/media-source streams (always include them, shown
// first). Local files are file URLs; WebDAV/SMB media-source streams
// are remote URLs that carry no resolution metadata nothing else
// produces a non-adaptive remote stream without resolution, so that
// combination identifies them.
let downloadedStreams: [Stream] = streams.filter { (stream: Stream) -> Bool in
guard !stream.isAudioOnly else { return false }
if stream.url.isFileURL { return true }
let format = StreamFormat.detect(from: stream)
return stream.resolution == nil && format != .hls && format != .dash
}
// Online streams need resolution to be shown
let onlineVideoStreams: [Stream] = streams
@@ -95,6 +104,9 @@ extension QualitySelectorView {
let allowSoftware = allowSoftwareDecodedFormats
return videoStreams.filter { (stream: Stream) -> Bool in
if stream.url.isFileURL { return true }
// Media-source streams (no resolution metadata, nil codec) must
// not be misclassified as software-decoded and hidden
if stream.resolution == nil { return true }
if stream.isMuxed { return true }
if allowSoftware { return true }
return !requiresSoftwareDecode(stream.videoCodec)
@@ -105,6 +117,7 @@ extension QualitySelectorView {
if allowSoftwareDecodedFormats { return [] }
return videoStreams.filter { (stream: Stream) -> Bool in
if stream.url.isFileURL { return false }
if stream.resolution == nil { return false }
if stream.isMuxed { return false }
return requiresSoftwareDecode(stream.videoCodec)
}