[vlc-commits] [Git][videolan/vlc][master] 2 commits: macosx: don't treat media as audio-only when video tracks are present
Felix Paul Kühne (@fkuehne)
gitlab at videolan.org
Tue May 5 14:55:08 UTC 2026
Felix Paul Kühne pushed to branch master at VideoLAN / VLC
Commits:
9809b679 by Felix Paul Kühne at 2026-05-04T16:43:23+02:00
macosx: don't treat media as audio-only when video tracks are present
- - - - -
d0a89f94 by Felix Paul Kühne at 2026-05-04T16:43:26+02:00
macosx: keep voutView mounted while audio decoration is shown
Swapping voutView out of voutContainingView when an audio track plays
left the vout module with a detached NSView if the same item later
exposed a video track (m4b chapter slides). VLCPlayerTrackListChanged
runs async on the main queue while WindowEnable runs sync; the layer
could bind before the swap-back, and slides never rendered.
Layer audioDecorativeView on top instead of replacing voutView.
- - - - -
2 changed files:
- modules/gui/macosx/playqueue/VLCPlayerController.m
- modules/gui/macosx/windows/video/VLCMainVideoViewController.m
Changes:
=====================================
modules/gui/macosx/playqueue/VLCPlayerController.m
=====================================
@@ -880,13 +880,17 @@ static int BossCallback(vlc_object_t *p_this,
return NO;
}
+ if (self.videoTracks.count > 0) {
+ return NO;
+ }
+
VLCMediaLibraryMediaItem * const mediaItem =
[VLCMediaLibraryMediaItem mediaItemForURL:currentItemUrl];
if (mediaItem != nil) {
return mediaItem.mediaType == VLC_ML_MEDIA_TYPE_AUDIO;
}
- return self.videoTracks.count == 0 && self.audioTracks.count > 0;
+ return self.audioTracks.count > 0;
}
- (void)stateChanged:(enum vlc_player_state)state
=====================================
modules/gui/macosx/windows/video/VLCMainVideoViewController.m
=====================================
@@ -268,9 +268,27 @@ NSString * const VLCUseClassicVideoPlayerLayoutKey = @"VLCUseClassicVideoPlayerL
const BOOL isAudioOnly = controller.currentMediaIsAudioOnly;
const BOOL isVisualActive = [self isVisualizationActive];
const BOOL decorativeViewVisible = isAudioOnly && !isVisualActive;
- NSView * const targetView = decorativeViewVisible ? self.audioDecorativeView : self.voutView;
- self.voutContainingView.subviews = @[targetView];
- [targetView applyConstraintsToFillSuperview];
+
+ // Keep voutView mounted so the macOS vout module always finds an in-window
+ // NSView when WindowEnable runs. Otherwise an audio item that later exposes
+ // a video track (e.g. m4b chapter slides) races: WindowEnable can land
+ // before VLCPlayerTrackListChanged re-attaches voutView, and the vout
+ // module then binds its layer to a detached view.
+ if (self.voutView.superview != self.voutContainingView) {
+ [self.voutContainingView addSubview:self.voutView
+ positioned:NSWindowBelow
+ relativeTo:nil];
+ [self.voutView applyConstraintsToFillSuperview];
+ }
+
+ if (decorativeViewVisible) {
+ if (self.audioDecorativeView.superview != self.voutContainingView) {
+ [self.voutContainingView addSubview:self.audioDecorativeView];
+ [self.audioDecorativeView applyConstraintsToFillSuperview];
+ }
+ } else {
+ [self.audioDecorativeView removeFromSuperview];
+ }
if (decorativeViewVisible) {
[self setAutohideControls:NO];
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/870a7f6ddf1a6d82241c6cdfd60edb452f0e3d84...d0a89f94fb0003aa41b23b6b259946242f8f0476
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/870a7f6ddf1a6d82241c6cdfd60edb452f0e3d84...d0a89f94fb0003aa41b23b6b259946242f8f0476
You're receiving this email because of your account on code.videolan.org.
More information about the vlc-commits
mailing list