TGViewer
Telegram github commits and releases Telegram github commits and releases @tgappsupdates · 4.53K subscribers
Post #20566 72
UnigramDev/Unigram/swapchain-diagnostics • daaee85 • 2 files, +50/-5
Log why the video swap chain failed, and don't crash when it does

AsyncMediaPlayerSwapChain::Create() swallowed every failure and returned false,
so the only trace left was SwapChainOptions() throwing "You must wait for the
VideoView to be loaded before calling GetSwapChainOptions()" -- a message
inherited from LibVLCSharp that describes a lifecycle mistake this code cannot
make. The real cause is that one of the Direct3D calls failed, and nothing
recorded which one. That throw crossed a XAML Loaded handler (gallery video,
stories, the music player all construct AsyncMediaPlayer there) and became an
unhandled exception, reported by crash telemetry on 12.8.1 and 12.9.

Create() now names each stage as it goes and logs the stage, the HRESULT and
the message, so the next report says which driver call failed. The thrown
message says what actually happened.

The player no longer fails construction over it: the Direct3D device can
legitimately be unavailable while the display driver is resetting, and there is
nothing the caller could do about it. When the swap chain is not loaded the
player is built with --no-video instead, so audio still plays and the failure
is in the log rather than in a crash.

Also releases m_d3d11Device/m_deviceContext between adapter attempts --
com_ptr::put() overwrites without releasing, so a failed attempt could strand a
device.

Not built: no UWP/.NET Native build environment here.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

#unigram
More from @tgappsupdates
  1. Oct 14, 2026telegramdesktop/tdesktop/dev • 2db9f88 • 1 files, +3/-1 Hide the topics toggle in broadcas…
  2. Oct 14, 2026morethanwords/tweb/master • 1e5cf6a • 7 files, +155/-16 Tell the bot the saved shipping ad…
  3. Oct 13, 2026telegramdesktop/tdesktop/dev • 5acda87 • 2 files, +10/-4 [ai] Raised the cross-review roun…
  4. Oct 13, 2026telegramdesktop/tdesktop/dev • 3c9f6ee • 1 files, +8/-8 Bump actions/download-artifact fro…
  5. Oct 13, 2026TGX-Android/Telegram-X/main • e8a46a1 • 3 files, +27/-7 Update `.gitmodules` #tgxandroid
  6. Oct 13, 2026UnigramDev/Unigram/develop • 7842fff • 5 files, +1215/-148 Group the rich editor toolbar's…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →