-
-
Notifications
You must be signed in to change notification settings - Fork 42
fix(playback): trust the server's media runtime end to end #482
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -125,16 +125,21 @@ func reprobeMayScanPackets(file *models.MediaFile) bool { | |
| return false | ||
| } | ||
| return file.Duration <= 0 || | ||
| videoDurationImplausiblyShort(float64(file.Duration), file.FileSize, true) | ||
| videoDurationImplausible(float64(file.Duration), file.FileSize, true) | ||
| } | ||
|
|
||
| // legacyProbeDurationFixTime is when the probe duration parser stopped | ||
| // treating large ffprobe durations as microseconds. Rows probed before this | ||
| // may carry the collapsed durations that conversion produced. Rows probed | ||
| // after it are authoritative: a still-short duration was re-derived from | ||
| // packet timestamps, and re-flagging it would reprobe genuinely short clips | ||
| // on every playback decision forever. Adjust if this fix ships later. | ||
| var legacyProbeDurationFixTime = time.Date(2026, time.July, 18, 0, 0, 0, 0, time.UTC) | ||
| // legacyProbeDurationFixTime marks the revision of the duration-validity rule | ||
| // in probe.go. Rows probed before it were judged by an older, weaker rule and | ||
| // are re-checked once under the current one. Rows probed after it are | ||
| // authoritative: their duration already passed the current rule, and | ||
| // re-flagging them would reprobe genuinely short clips on every playback | ||
| // decision forever. | ||
| // | ||
| // Bump this whenever videoDurationImplausible changes, or existing rows never | ||
| // re-converge on the improved rule. Last bumped when the implied-bitrate | ||
| // ceiling was added, which catches durations the absolute floor missed — | ||
| // a feature film probing as 61 seconds passed the old rule untouched. | ||
| var legacyProbeDurationFixTime = time.Date(2026, time.July, 26, 0, 0, 0, 0, time.UTC) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Any server running the previous binary after Useful? React with 👍 / 👎. |
||
|
|
||
| func needsLegacyDurationRepair(file *models.MediaFile) bool { | ||
| if file == nil { | ||
|
|
@@ -144,7 +149,7 @@ func needsLegacyDurationRepair(file *models.MediaFile) bool { | |
| } | ||
|
|
||
| func legacyDurationRepairNeeded(duration int, sizeBytes int64, hasVideo bool, probeUpdatedAt *time.Time) bool { | ||
| if !videoDurationImplausiblyShort(float64(duration), sizeBytes, hasVideo) { | ||
| if !videoDurationImplausible(float64(duration), sizeBytes, hasVideo) { | ||
| return false | ||
| } | ||
| return probeUpdatedAt == nil || probeUpdatedAt.Before(legacyProbeDurationFixTime) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For legitimate sources whose aggregate bitrate exceeds 1 Gbps, this rejects an otherwise correct ffprobe duration; an 8K/4320p ProRes 4444 XQ source can exceed this threshold even though the repository explicitly handles 4320p media.
ProbeFileconsequently falls back to enumerating every video packet in what can be a hundreds-of-gigabytes file, blocking normal scans and potentially exhausting the playback repair's one-minute timeout. Use a codec/resolution-aware bound or a narrower malformed-timestamp signature rather than treating every source above this fixed ceiling as impossible.AGENTS.md reference: AGENTS.md:L12-L14
Useful? React with 👍 / 👎.