Switching between video tracks is bugged and can crash VLC 4
Steps to reproduce:
- take/make some media with several video tracks
- start playing it in VLC trunk on Windows
- in the Video menu, select second track. Expected result: EITHER second window opens to play the second track simultaneously with the first track, and menu changes to show both tracks selected, OR video shows in the window changes to the second track contents, and menu shows second track selected. Actual result: window shows the second track contents, but menu shows BOTH tracks selected.
- in the Video menu, deselect the first track. Expected result: first window closes, and the second window keeps playing (or first window goes into no-video mode while the second window keeps playing, or the first window adopts the second video contents, or something else what makes sense). Actual result: the only window goes into no-video mode, even though the second track is still selected.
- in the Video menu, deselect the second track. Expected result: window in a no-video mode, audio still playing. Actual result: VLC crashes on an assert.
This seems to be a regression introduced during Qt 6 migration; I've managed to get within few revisions of that point during bisect, and all of the remaining revisions were qt-related. Before the migration, VLC opened another window for the second track. After the migration, VLC uses the same window (as if switching between tracks like audio/subtitle tracks do), yet the video menu is still a multi-choice control. Obviously, one does not match the other, hence the bug. This may be Qt-only.
The callstack during an assert:
vlc::CompositorDirectComposition::windowDisable() modules\gui\qt\maininterface\compositor_dcomp.cpp:89
const auto ret = m_rootVisual->RemoveVisual(m_videoVisual.Get());
assert(ret == S_OK);
windowDisableCb::<lambda0>::operator()() modules\gui\qt\maininterface\compositor.cpp:127
QMetaObject::invokeMethod(that, [that](){
that->windowDisable();
}, Qt::BlockingQueuedConnection);
... qt slot machinery
... event processing