fix: 删除用 mp4box.js 维度数据设置 videoDimRef 的代码
CI/CD Pipeline / Build Staging Worker Image (push) Successful in 54s
CI/CD Pipeline / Build Staging API Image (push) Successful in 2m37s
CI/CD Pipeline / Frontend Unit Tests (push) Successful in 3m44s
CI/CD Pipeline / Validate - Migration (alembic) (push) Successful in 4m38s
CI/CD Pipeline / Build Staging Web Image (push) Successful in 4m50s
CI/CD Pipeline / Validate - Type Check (mypy) (push) Successful in 5m9s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (push) Successful in 1m5s
CI/CD Pipeline / ACR Image Cleanup (push) Successful in 49s
CI/CD Pipeline / Staging E2E Tests (push) Failing after 1m24s
CI/CD Pipeline / Staging API Integration Tests (push) Successful in 3m7s
CI/CD Pipeline / Validate - Code Quality (push) Successful in 12m9s
CI/CD Pipeline / Unit Tests (push) Successful in 17m7s
CI/CD Pipeline / Integration Tests (push) Successful in 36m33s
CI/CD Pipeline / CI Gate (push) Failing after 648h0m24s
CI/CD Pipeline / Production Browser E2E (push) Failing after 648h32m0s
CI/CD Pipeline / Deploy Production (push) Failing after 648h32m1s
CI/CD Pipeline / Build Production Worker Image (push) Failing after 648h32m2s
CI/CD Pipeline / Build Production API Image (push) Failing after 648h32m2s
CI/CD Pipeline / PR Build Worker Image (push) Failing after 648h48m12s
CI/CD Pipeline / PR Build API Image (push) Failing after 648h48m16s
CI/CD Pipeline / Frontend Lint (push) Failing after 648h49m10s
CI/CD Pipeline / Check if frontend-only change (push) Failing after 648h49m12s
CI/CD Pipeline / Canary Release to Production (push) Failing after 649h5m47s
CI/CD Pipeline / Build Production Web Image (push) Failing after 649h5m48s
CI/CD Pipeline / PR Build Web Image (push) Failing after 649h22m0s

- 删除 decoder configure 成功后的 videoDimRef 设置
- 删除 init 函数中的 videoDimRef 设置
- 唯一可靠的尺寸来源改为 VideoDecoder output 回调从 VideoFrame 获取的真实帧尺寸
This commit is contained in:
xiaoxia
2026-08-20 14:37:07 +08:00
parent 6a3f4e4127
commit f4af6ec8b7
@@ -492,11 +492,6 @@ export function useCanvasPlayer(
decoderReady = true
// 标记缓冲结束,让 UI 开始渲染
setState((s) => ({ ...s, isBuffering: false }))
// 更新视频尺寸(用于 aspect ratio)
if (meta.videoWidth > 0 && meta.videoHeight > 0) {
videoDimRef.current = { width: meta.videoWidth, height: meta.videoHeight }
}
} catch (err) {
console.error("[useCanvasPlayer] Decoder configure failed for segment:", err)
return
@@ -875,12 +870,7 @@ export function useCanvasPlayer(
segmentMetaRef.current = metas
// 3. 设置视频尺寸(用第一个片段的尺寸)
if (metas[0].videoWidth > 0 && metas[0].videoHeight > 0) {
videoDimRef.current = { width: metas[0].videoWidth, height: metas[0].videoHeight }
}
// 4. 按需解码:初始只解码前 3 个片段,后续通过 decodeAroundPosition 动态加载
// 3. 按需解码:初始只解码前 3 个片段,后续通过 decodeAroundPosition 动态加载
// 避免一次性全量解码导致 frameQueue 环形缓冲区旧帧被丢弃引发黑屏
decodedSegmentsRef.current.clear()
const initGen = decodeGenerationRef.current