[vlc-commits] [Git][videolan/vlc][master] 4 commits: macosx/strings: add Audio-DVD detection code
Felix Paul Kühne (@fkuehne)
gitlab at videolan.org
Sat Apr 18 14:26:51 UTC 2026
Felix Paul Kühne pushed to branch master at VideoLAN / VLC
Commits:
6090d203 by Felix Paul Kühne at 2026-04-18T14:47:45+02:00
macosx/strings: add Audio-DVD detection code
- - - - -
42a622dd by Felix Paul Kühne at 2026-04-18T14:47:45+02:00
macosx/open: add DVD-Audio support
- - - - -
fcf2a6b7 by Felix Paul Kühne at 2026-04-18T14:47:45+02:00
macosx/playqueue: fix DVD-Audio URI for auto-detected optical media
- - - - -
d29c39ee by Felix Paul Kühne at 2026-04-18T14:47:45+02:00
macosx/open: allow switching a DVD-Audio disc to DVD-Video playback
Reuse the DVD view for DVD-Audio discs and repurpose the Disable DVD
menus button to toggle the MRL between dvda:// and dvdnav://, so the
video side of a hybrid disc can be played without leaving the panel.
- - - - -
4 changed files:
- modules/gui/macosx/extensions/NSString+Helpers.h
- modules/gui/macosx/extensions/NSString+Helpers.m
- modules/gui/macosx/playqueue/VLCPlayQueueController.m
- modules/gui/macosx/windows/VLCOpenWindowController.m
Changes:
=====================================
modules/gui/macosx/extensions/NSString+Helpers.h
=====================================
@@ -1,7 +1,7 @@
/*****************************************************************************
* NSString+Helpers.h: Category with helper functions for NSStrings
*****************************************************************************
- * Copyright (C) 2002-2019 VLC authors and VideoLAN
+ * Copyright (C) 2002-2025 VLC authors and VideoLAN
*
* Authors: Jon Lech Johansen <jon-vl at nanocrew.net>
* Christophe Massiot <massiot at via.ecp.fr>
@@ -52,6 +52,7 @@
extern NSString *const kVLCMediaAudioCD;
extern NSString *const kVLCMediaDVD;
+extern NSString *const kVLCMediaAudioDVD;
extern NSString *const kVLCMediaVCD;
extern NSString *const kVLCMediaSVCD;
extern NSString *const kVLCMediaBD;
=====================================
modules/gui/macosx/extensions/NSString+Helpers.m
=====================================
@@ -1,7 +1,7 @@
/*****************************************************************************
* NSString+Helpers.m: Category with helper functions for NSStrings
*****************************************************************************
- * Copyright (C) 2002-2019 VLC authors and VideoLAN
+ * Copyright (C) 2002-2025 VLC authors and VideoLAN
*
* Authors: Jon Lech Johansen <jon-vl at nanocrew.net>
* Christophe Massiot <massiot at via.ecp.fr>
@@ -41,6 +41,7 @@
NSString *const kVLCMediaAudioCD = @"AudioCD";
NSString *const kVLCMediaDVD = @"DVD";
+NSString *const kVLCMediaAudioDVD = @"AudioDVD";
NSString *const kVLCMediaVCD = @"VCD";
NSString *const kVLCMediaSVCD = @"SVCD";
NSString *const kVLCMediaBD = @"Blu-ray";
@@ -348,6 +349,26 @@ NSString * getVolumeTypeFromMountPath(NSString *mountPath)
returnValue = kVLCMediaAudioCD;
} else if (IOObjectConformsTo(service, kIODVDMediaClass)) {
returnValue = kVLCMediaDVD;
+
+ // NSFileManager is not thread-safe, don't use defaultManager outside of the main thread
+ NSFileManager *fileManager = [[NSFileManager alloc] init];
+
+ // check for AUDIO_TS and see if the folder contents identify as an Audio-DVD
+ NSString *audioTSPath = [mountPath stringByAppendingPathComponent:@"AUDIO_TS"];
+ BOOL audioTSExists = NO;
+ [fileManager fileExistsAtPath:audioTSPath isDirectory:&audioTSExists];
+ if (audioTSExists) {
+ NSSet *audioExtensions = [NSSet setWithObjects:@"aob", @"ifo", nil];
+ NSArray *audioTSFolderItems = [fileManager contentsOfDirectoryAtPath:audioTSPath error:nil];
+
+ for (NSString *fileItem in audioTSFolderItems) {
+ NSString *fileItemExtension = fileItem.pathExtension.lowercaseString;
+ if ([audioExtensions containsObject:fileItemExtension]) {
+ returnValue = kVLCMediaAudioDVD;
+ break;
+ }
+ }
+ }
} else if (IOObjectConformsTo(service, kIOBDMediaClass)) {
returnValue = kVLCMediaBD;
}
=====================================
modules/gui/macosx/playqueue/VLCPlayQueueController.m
=====================================
@@ -1,7 +1,7 @@
/*****************************************************************************
* VLCPlayQueueController.m: MacOS X interface module
*****************************************************************************
- * Copyright (C) 2019 VLC authors and VideoLAN
+ * Copyright (C) 2019-2025 VLC authors and VideoLAN
*
* Authors: Felix Paul Kühne <fkuehne # videolan -dot- org>
*
@@ -660,6 +660,8 @@ static const struct vlc_playlist_callbacks playlist_callbacks = {
if ([diskType isEqualToString: kVLCMediaDVD])
uri = [NSString stringWithFormat: @"dvdnav://%@", getBSDNodeFromMountPath(path)];
+ else if ([diskType isEqualToString: kVLCMediaAudioDVD])
+ uri = [NSString stringWithFormat: @"dvda://%@", getBSDNodeFromMountPath(path)];
else if ([diskType isEqualToString: kVLCMediaVideoTSFolder])
uri = [NSString stringWithFormat: @"dvdnav://%@", path];
else if ([diskType isEqualToString: kVLCMediaAudioCD])
=====================================
modules/gui/macosx/windows/VLCOpenWindowController.m
=====================================
@@ -1,7 +1,7 @@
/*****************************************************************************
* VLCOpenWindowController.m: Open dialogues for VLC's MacOS X port
*****************************************************************************
- * Copyright (C) 2002-2021 VLC authors and VideoLAN
+ * Copyright (C) 2002-2025 VLC authors and VideoLAN
*
* Authors: Jon Lech Johansen <jon-vl at nanocrew.net>
* Christophe Massiot <massiot at via.ecp.fr>
@@ -94,6 +94,8 @@ NSString *const VLCOpenTextFieldWasClicked = @"VLCOpenTextFieldWasClicked";
BOOL b_autoplay;
BOOL b_nodvdmenus;
+ BOOL b_currentDiscIsDVDA;
+ BOOL b_dvdaPlayingAsVideo;
NSView *_currentOpticalMediaView;
NSImageView *_currentOpticalMediaIconView;
NSMutableArray <VLCOpenBlockDeviceDescription *>*_allMediaDevices;
@@ -712,6 +714,11 @@ NSString *const VLCOpenTextFieldWasClicked = @"VLCOpenTextFieldWasClicked";
NSImage *mediaIcon = deviceDescription.mediaIcon;
NSFileManager *fileManager = [NSFileManager defaultManager];
+ b_currentDiscIsDVDA = [diskType isEqualToString:kVLCMediaAudioDVD];
+ b_dvdaPlayingAsVideo = NO;
+ if (!b_currentDiscIsDVDA)
+ [_discDVDDisableMenusButton setTitle:_NS("Disable DVD menus")];
+
if ([diskType isEqualToString: kVLCMediaDVD] || [diskType isEqualToString: kVLCMediaVideoTSFolder]) {
[_discDVDLabel setStringValue: [[NSFileManager defaultManager] displayNameAtPath:opticalDevicePath]];
[_discDVDwomenusLabel setStringValue: [_discDVDLabel stringValue]];
@@ -723,6 +730,11 @@ NSString *const VLCOpenTextFieldWasClicked = @"VLCOpenTextFieldWasClicked";
[self setMRL: [NSString stringWithFormat: @"dvdread://%@#%i:%i-", devicePath, [_discDVDwomenusTitleTextField intValue], [_discDVDwomenusChapterTextField intValue]]];
[self showOpticalMediaView: _discDVDwomenusView withIcon:mediaIcon];
}
+ } else if ([diskType isEqualToString: kVLCMediaAudioDVD]) {
+ [_discDVDLabel setStringValue: [fileManager displayNameAtPath:opticalDevicePath]];
+ [_discDVDDisableMenusButton setTitle:_NS("Play as DVD-Video")];
+ [self setMRL:[NSString stringWithFormat:@"dvda://%@", devicePath]];
+ [self showOpticalMediaView:_discDVDView withIcon:mediaIcon];
} else if ([diskType isEqualToString: kVLCMediaAudioCD]) {
[_discAudioCDLabel setStringValue: [fileManager displayNameAtPath: opticalDevicePath]];
[_discAudioCDTrackCountLabel setStringValue: [NSString stringWithFormat:_NS("%i tracks"), [[fileManager subpathsOfDirectoryAtPath: opticalDevicePath error:NULL] count] - 1]]; // minus .TOC.plist
@@ -892,6 +904,18 @@ NSString *const VLCOpenTextFieldWasClicked = @"VLCOpenTextFieldWasClicked";
{
NSString *devicePath = [[_allMediaDevices objectAtIndex:[_discSelectorPopup indexOfSelectedItem]] devicePath];
+ if (sender == _discDVDDisableMenusButton && b_currentDiscIsDVDA) {
+ b_dvdaPlayingAsVideo = !b_dvdaPlayingAsVideo;
+ if (b_dvdaPlayingAsVideo) {
+ [_discDVDDisableMenusButton setTitle:_NS("Play as DVD-Audio")];
+ [self setMRL:[NSString stringWithFormat:@"dvdnav://%@", devicePath]];
+ } else {
+ [_discDVDDisableMenusButton setTitle:_NS("Play as DVD-Video")];
+ [self setMRL:[NSString stringWithFormat:@"dvda://%@", devicePath]];
+ }
+ return;
+ }
+
if (sender == _discDVDwomenusEnableMenusButton) {
b_nodvdmenus = NO;
[self setMRL: [NSString stringWithFormat: @"dvdnav://%@", devicePath]];
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/a2635612a85dd6941835dfa10a505dfb96dd12ce...d29c39ee526d0d2373a10bc240635f59b47f7bf1
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/a2635612a85dd6941835dfa10a505dfb96dd12ce...d29c39ee526d0d2373a10bc240635f59b47f7bf1
You're receiving this email because of your account on code.videolan.org.
More information about the vlc-commits
mailing list