Repository navigation
Version choice: measure a version picked by hand from its own fetch - #1333
Merged
Merged
Conversation
request_env clears src_kbps for a picked version, because the value describes the default one, and says the pick is measured from its own fetch. build_stream did that only for the automatic choice, so Play Version started with src_kbps 0, which fails closed: with a quality rung selected, the play routed to the re-encode even when the picked version fits. Any fetched version now takes its PlayingItem::bitrate. The new test picks the 1080p copy of a 4K-first item at 1080p quality and expects (2372, 1920, 800); before the fix it got (0, 1920, 800). Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Filippo Scatigna <[email protected]>
…fault When the version picked by hand is no longer on the item, build_stream plays the default it fetched, but measured it with env.src_kbps, which request_env sets to 0 for any picked version. With a quality rung selected that fell back to the re-encode. Whenever a version was asked for, the fetched item's bitrate is used now. The new test asks for a version id the item does not have and expects the default's 14663 kbps; before the fix it got 0. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Filippo Scatigna <[email protected]>
PlayingItem::bitrate is the whole-file rate of the version that plays, not always Media[0]'s, and cur_src.0 is the video stream's rate only for the default version measured from the detail: a fetched version carries its whole-file rate. Both comments were already loose for the automatic choice; this branch widened them to Play Version. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Filippo Scatigna <[email protected]>
Collaborator
|
Thank you! Merged, it'll go out with the release. |
nphil
added a commit
to nphil/Marquee
that referenced
this pull request
Nov 18, 2026
Play starts a version the TV can decode when the first one listed is one it cannot (a codec the set lacks, a resolution above it, or a Dolby Vision Profile 5 copy when the set shows none), instead of leaving the server to convert it. Forced Direct Play still tries the first copy. A substituted default and a version picked by hand are measured from the fetch that names them, and the quality limit judges every version on its own video bitrate, as the first copy always was. A retry that moves to another file keeps its audio and subtitle choice only while it stays on the same file. Ported from upstream 6131d5c (Default to a playback version the TV can decode (plxnative#1245)). Ported from upstream 301811e (Version choice: measure a version picked by hand from its own fetch (plxnative#1333)). Ported from upstream a056817 (Version choice: judge each version's Dolby Vision as the direct-play gate does (plxnative#1421)). Ported from upstream 3878e4f (Quality ceiling: judge every version on its video bitrate, as Media[0] is (plxnative#1423)).
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.
Follow-up 1 from my comment on #1245.
request_envclearssrc_kbpsfor a picked version, since that value describes the default one, and says the pick "is measured from its own fetch" (media/src/route/decision.rs:10322). Butbuild_streamtook the fetched item's bitrate only for the automatic choice (media/src/route/plan.rs:1878), so Play Version started withsrc_kbps0. Zero fails closed: with a quality rung selected, the play went to the re-encode even when the picked version fits the rung.Three commits:
PlayingItem::bitrate. Test:a_version_picked_by_hand_is_measured_from_its_own_fetchpicks the 1080p copy of a 4K-first item at 1080p quality and expectssrc_measure == (2372, 1920, 800). Before the fix it got(0, 1920, 800).request_envleft. Test:a_picked_version_that_is_gone_is_measured_from_the_default_that_playsexpects 14663 kbps; before, 0.PlayingItem::bitrateis the played version's rate, not alwaysMedia[0]'s, andcur_src.0is the video stream's rate only for the default measured from the detail.Checks
On c56d509, WSL2 x86_64:
make check: 44 suites, 26485 passed, 0 failed, 200 ignored (all 127 steps ok).make check-nodef: clean.cargo check --lib --target armv7-unknown-linux-gnueabi -p plx_media: clean.make test-crate C=plx_media T=version_tests: 41 passed.pr-reviewer: no blocker or major. Its two minor points on this diff are fixed in ab59489 and c56d509. The third is follow-up 2: a fetched version is measured on the whole file while the default from the detail prefers the video stream, so at a tight rung Play Version can re-encode a file that Play from the detail page plays directly. It fails in the conservative direction, as the automatic choice already did.Not covered
🤖 Generated with Claude Code