fix: defer -sv resolution validation for single m3u8 stream#853
Open
andya1lan wants to merge 2 commits intonilaoda:mainfrom
Open
fix: defer -sv resolution validation for single m3u8 stream#853andya1lan wants to merge 2 commits intonilaoda:mainfrom
-sv resolution validation for single m3u8 stream#853andya1lan wants to merge 2 commits intonilaoda:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes -sv res filtering behavior for single-stream HLS playlists that lack RESOLUTION metadata by deferring resolution validation until FFmpeg media info is available during download.
Changes:
- Update resolution filtering to keep the lone candidate when playlist resolution metadata is missing (single-stream m3u8).
- Add post-probe validation of
-sv resagainst FFmpeg-detected video resolution and emit clearer error messages. - Add new localized resource strings for resolution mismatch reporting.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/N_m3u8DL-RE/Util/FilterUtil.cs |
Defers ResolutionReg filtering when there’s exactly one candidate and its resolution is missing. |
src/N_m3u8DL-RE/DownloadManager/SimpleDownloadManager.cs |
Adds resolution validation after media info probing and stops the stream download on mismatch. |
src/N_m3u8DL-RE.Common/Resource/StaticText.cs |
Introduces new localized strings for the resolution mismatch error. |
src/N_m3u8DL-RE.Common/Resource/ResString.cs |
Exposes the new resource keys through ResString. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ameters Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix
-svresolution select behavior for single stream m3u8 inputs by deferring validation until actual media info is available.Changes
Keep single stream candidates when playlist resolution metadata is missing.
Validate the resolution parameter against probed video resolution after media info is read.
Fail gracefully with user-friendly error messages.
Result
Master m3u8: filter behavior unchanged.
Single m3u8: matches continue; mismatches fail clearly and safely.