Projects
Extra
vlc-beta
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 71
View file
_service:obs_scm:vlc-beta-20250624.dde35b7bd5.obscpio/modules/demux/mkv/matroska_segment_parse.cpp -> _service:obs_scm:vlc-beta-20250626.14217002b5.obscpio/modules/demux/mkv/matroska_segment_parse.cpp
Changed
@@ -2048,6 +2048,11 @@ vars.p_fmt->i_codec = VLC_CODEC_A52; vars.p_fmt->b_packetized = false; } + S_CASE("A_ATRAC/AT1") { + ONLY_FMT(AUDIO); + vars.p_fmt->i_codec = VLC_CODEC_ATRAC1; + vars.p_tk->fmt.audio.i_blockalign = vars.p_tk->fmt.audio.i_channels * 212; + } S_CASE("A_EAC3") { vars.p_fmt->i_codec = VLC_CODEC_EAC3; vars.p_fmt->b_packetized = false;
View file
_service:obs_scm:vlc-beta-20250624.dde35b7bd5.obscpio/modules/gui/macosx/library/VLCInputItem.h -> _service:obs_scm:vlc-beta-20250626.14217002b5.obscpio/modules/gui/macosx/library/VLCInputItem.h
Changed
@@ -42,7 +42,7 @@ @interface VLCInputItem : NSObject<VLCLocallyManipulableItemProtocol> + (nullable instancetype)inputItemFromURL:(NSURL *)url; -- (instancetype)initWithInputItem:(struct input_item_t *)p_inputItem; +- (nullable instancetype)initWithInputItem:(struct input_item_t *)p_inputItem; @property (readonly) struct input_item_t *vlcInputItem; @property (readonly) NSString *MRL;
View file
_service:obs_scm:vlc-beta-20250624.dde35b7bd5.obscpio/modules/gui/macosx/library/VLCInputItem.m -> _service:obs_scm:vlc-beta-20250626.14217002b5.obscpio/modules/gui/macosx/library/VLCInputItem.m
Changed
@@ -86,43 +86,36 @@ return inputItem; } -- (instancetype)initWithInputItem:(struct input_item_t *)p_inputItem +- (nullable instancetype)initWithInputItem:(struct input_item_t *)p_inputItem { self = super init; if (self && p_inputItem != NULL) { - _vlcInputItem = p_inputItem; - input_item_Hold(_vlcInputItem); + _vlcInputItem = input_item_Hold(p_inputItem); + } else { + return nil; } return self; } - (void)dealloc { - if (_p_parserID) { + if (_p_parserID) input_item_parser_id_Release(_p_parserID); - } - input_item_Release(_vlcInputItem); + if (_vlcInputItem) + input_item_Release(_vlcInputItem); } - (NSString *)name { - if (_vlcInputItem) { - return toNSStr(_vlcInputItem->psz_name); - } - return @""; + return toNSStr(_vlcInputItem->psz_name); } - (void)setName:(NSString *)name { - if (_vlcInputItem) { - input_item_SetName(_vlcInputItem, name UTF8String); - } + input_item_SetName(_vlcInputItem, name UTF8String); } - (NSString *)title { - if (!_vlcInputItem) { - return nil; - } char *psz_title = input_item_GetTitle(_vlcInputItem); if (!psz_title) { return self.name; @@ -135,16 +128,11 @@ -(void)setTitle:(NSString *)title { - if (_vlcInputItem) { - input_item_SetTitle(_vlcInputItem, title UTF8String); - } + input_item_SetTitle(_vlcInputItem, title UTF8String); } - (NSString *)artist { - if (!_vlcInputItem) { - return nil; - } char *psz_artist = input_item_GetArtist(_vlcInputItem); NSString *returnValue = toNSStr(psz_artist); FREENULL(psz_artist); @@ -152,16 +140,11 @@ } - (void)setArtist:(NSString *)artist { - if (_vlcInputItem) { - input_item_SetArtist(_vlcInputItem, artist UTF8String); - } + input_item_SetArtist(_vlcInputItem, artist UTF8String); } - (NSString *)album { - if (!_vlcInputItem) { - return nil; - } char *psz_album = input_item_GetAlbum(_vlcInputItem); NSString *returnValue = toNSStr(psz_album); FREENULL(psz_album); @@ -169,16 +152,11 @@ } - (void)setAlbum:(NSString *)albumName { - if (_vlcInputItem) { - input_item_SetAlbum(_vlcInputItem, albumName UTF8String); - } + input_item_SetAlbum(_vlcInputItem, albumName UTF8String); } - (NSString *)trackNumber { - if (!_vlcInputItem) { - return nil; - } char *psz_trackNumber = input_item_GetTrackNumber(_vlcInputItem); NSString *returnValue = toNSStr(psz_trackNumber); FREENULL(psz_trackNumber); @@ -186,16 +164,11 @@ } - (void)setTrackNumber:(NSString *)trackNumber { - if (_vlcInputItem) { - input_item_SetTrackNumber(_vlcInputItem, trackNumber UTF8String); - } + input_item_SetTrackNumber(_vlcInputItem, trackNumber UTF8String); } - (NSString *)genre { - if (!_vlcInputItem) { - return nil; - } char *psz_genre = input_item_GetGenre(_vlcInputItem); NSString *returnValue = toNSStr(psz_genre); FREENULL(psz_genre); @@ -203,16 +176,11 @@ } - (void)setGenre:(NSString *)genre { - if (_vlcInputItem) { - input_item_SetGenre(_vlcInputItem, genre UTF8String); - } + input_item_SetGenre(_vlcInputItem, genre UTF8String); } - (NSString *)copyright { - if (!_vlcInputItem) { - return nil; - } char *psz_copyright = input_item_GetCopyright(_vlcInputItem); NSString *returnValue = toNSStr(psz_copyright); FREENULL(psz_copyright); @@ -220,16 +188,11 @@ } - (void)setCopyright:(NSString *)copyright { - if (_vlcInputItem) { - input_item_SetCopyright(_vlcInputItem, copyright UTF8String); - } + input_item_SetCopyright(_vlcInputItem, copyright UTF8String); } - (NSString *)publisher { - if (!_vlcInputItem) { - return nil; - } char *psz_publisher = input_item_GetPublisher(_vlcInputItem); NSString *returnValue = toNSStr(psz_publisher); FREENULL(psz_publisher); @@ -237,16 +200,11 @@ } - (void)setPublisher:(NSString *)publisher { - if (_vlcInputItem) { - input_item_SetPublisher(_vlcInputItem, publisher UTF8String); - } + input_item_SetPublisher(_vlcInputItem, publisher UTF8String); } - (NSString *)nowPlaying { - if (!_vlcInputItem) { - return nil; - } char *psz_nowPlaying = input_item_GetNowPlaying(_vlcInputItem); NSString *returnValue = toNSStr(psz_nowPlaying); FREENULL(psz_nowPlaying); @@ -255,9 +213,6 @@ - (NSString *)language { - if (!_vlcInputItem) { - return nil; - } char *psz_language = input_item_GetLanguage(_vlcInputItem); NSString *returnValue = toNSStr(psz_language); FREENULL(psz_language); @@ -265,16 +220,11 @@ } - (void)setLanguage:(NSString *)language { - if (_vlcInputItem) { - input_item_SetLanguage(_vlcInputItem, language UTF8String); - } + input_item_SetLanguage(_vlcInputItem, language UTF8String); } - (NSString *)date { - if (!_vlcInputItem) { - return nil; - } char *psz_date = input_item_GetDate(_vlcInputItem); NSString *returnValue = toNSStr(psz_date); FREENULL(psz_date); @@ -282,16 +232,11 @@ } - (void)setDate:(NSString *)date { - if (_vlcInputItem) { - input_item_SetDate(_vlcInputItem, date UTF8String); - } + input_item_SetDate(_vlcInputItem, date UTF8String); } - (NSString *)contentDescription { - if (!_vlcInputItem) { - return nil; - } char *psz_description = input_item_GetDescription(_vlcInputItem); NSString *returnValue = toNSStr(psz_description); FREENULL(psz_description); @@ -299,16 +244,11 @@ } - (void)setContentDescription:(NSString *)contentDescription { - if (_vlcInputItem) { - input_item_SetDescription(_vlcInputItem, contentDescription UTF8String); - } + input_item_SetDescription(_vlcInputItem, contentDescription UTF8String); } - (NSString *)encodedBy { - if (!_vlcInputItem) { - return nil; - } char *psz_encodedBy = input_item_GetEncodedBy(_vlcInputItem); NSString *returnValue = toNSStr(psz_encodedBy); FREENULL(psz_encodedBy); @@ -317,9 +257,6 @@ - (NSString *)trackID { - if (!_vlcInputItem) { - return nil; - } char *psz_trackID = input_item_GetTrackID(_vlcInputItem); NSString *returnValue = toNSStr(psz_trackID); FREENULL(psz_trackID); @@ -328,9 +265,6 @@ - (NSString *)trackTotal { - if (!_vlcInputItem) { - return nil; - } char *psz_trackTotal = input_item_GetTrackTotal(_vlcInputItem); NSString *returnValue = toNSStr(psz_trackTotal); FREENULL(psz_trackTotal); @@ -339,9 +273,6 @@ - (NSString *)director { - if (!_vlcInputItem) { - return nil; - } char *psz_director = input_item_GetDirector(_vlcInputItem); NSString *returnValue = toNSStr(psz_director); FREENULL(psz_director); @@ -349,16 +280,11 @@ } - (void)setDirector:(NSString *)director { - if (_vlcInputItem) { - input_item_SetDirector(_vlcInputItem, director UTF8String); - } + input_item_SetDirector(_vlcInputItem, director UTF8String); } - (NSString *)season { - if (!_vlcInputItem) { - return nil; - } char *psz_season = input_item_GetSeason(_vlcInputItem); NSString *returnValue = toNSStr(psz_season); FREENULL(psz_season); @@ -367,9 +293,6 @@ - (NSString *)episode { - if (!_vlcInputItem) { - return nil; - } char *psz_episode = input_item_GetEpisode(_vlcInputItem); NSString *returnValue = toNSStr(psz_episode); FREENULL(psz_episode); @@ -378,9 +301,6 @@ - (NSString *)showName { - if (!_vlcInputItem) { - return nil; - } char *psz_showName = input_item_GetShowName(_vlcInputItem); NSString *returnValue = toNSStr(psz_showName); FREENULL(psz_showName); @@ -388,16 +308,11 @@ } - (void)setShowName:(NSString *)showName { - if (_vlcInputItem) { - input_item_SetShowName(_vlcInputItem, showName UTF8String); - } + input_item_SetShowName(_vlcInputItem, showName UTF8String); } - (NSString *)actors { - if (!_vlcInputItem) { - return nil; - } char *psz_actors = input_item_GetActors(_vlcInputItem); NSString *returnValue = toNSStr(psz_actors); FREENULL(psz_actors); @@ -405,16 +320,11 @@ } - (void)setActors:(NSString *)actors { - if (_vlcInputItem) { - input_item_SetActors(_vlcInputItem, actors UTF8String); - } + input_item_SetActors(_vlcInputItem, actors UTF8String); } - (NSString *)discNumber { - if (!_vlcInputItem) { - return nil; - } char *psz_discNumber = input_item_GetDiscNumber(_vlcInputItem); NSString *returnValue = toNSStr(psz_discNumber); FREENULL(psz_discNumber); @@ -423,9 +333,6 @@ - (NSString *)totalNumberOfDiscs { - if (!_vlcInputItem) { - return nil; - } char *psz_totalDiscNumber = input_item_GetDiscTotal(_vlcInputItem); NSString *returnValue = toNSStr(psz_totalDiscNumber); FREENULL(psz_totalDiscNumber); @@ -434,26 +341,20 @@ - (NSString *)MRL { - if (_vlcInputItem) { - return toNSStr(_vlcInputItem->psz_uri); - } - return @""; + return toNSStr(_vlcInputItem->psz_uri); } - (NSString *)decodedMRL { - if (_vlcInputItem) { - char *psz_url = vlc_uri_decode(input_item_GetURI(_vlcInputItem)); - NSString *returnValue = toNSStr(psz_url); - FREENULL(psz_url); - return returnValue; - } - return nil; + char *psz_url = vlc_uri_decode(input_item_GetURI(_vlcInputItem)); + NSString *returnValue = toNSStr(psz_url); + FREENULL(psz_url); + return returnValue; } - (NSString*)path { - if (_vlcInputItem || (_vlcInputItem && _vlcInputItem->b_net)) { + if (!_vlcInputItem->b_net) { char *psz_url = input_item_GetURI(_vlcInputItem); if (!psz_url) { return @""; @@ -472,38 +373,27 @@ - (vlc_tick_t)duration { - if (_vlcInputItem) { - return _vlcInputItem->i_duration; - } - return -1; + return _vlcInputItem->i_duration; } - (enum input_item_type_e)inputType { - if (_vlcInputItem) { - return _vlcInputItem->i_type; - } - return ITEM_TYPE_UNKNOWN; + return _vlcInputItem->i_type; } - (NSURL *)artworkURL { - if (_vlcInputItem) { - char *p_artworkURL = input_item_GetArtworkURL(_vlcInputItem); - if (p_artworkURL) { - NSString *artworkURLString = toNSStr(p_artworkURL); - FREENULL(p_artworkURL); - return NSURL URLWithString:artworkURLString; - } + char *p_artworkURL = input_item_GetArtworkURL(_vlcInputItem); + if (p_artworkURL) { + NSString *artworkURLString = toNSStr(p_artworkURL); + FREENULL(p_artworkURL); + return NSURL URLWithString:artworkURLString; } return nil; } - (void)setArtworkURL:(NSURL *)artworkURL { - if (!_vlcInputItem) { - return; - } if (artworkURL != nil) { input_item_SetArtworkURL(_vlcInputItem, artworkURL.absoluteString.UTF8String); @@ -545,18 +435,12 @@ - (BOOL)preparsed { - if (_vlcInputItem) { - return input_item_IsPreparsed(_vlcInputItem); - } - return NO; + return input_item_IsPreparsed(_vlcInputItem); } - (BOOL)isStream { - if (_vlcInputItem) { - return (BOOL)_vlcInputItem->b_net; - } - return YES; + return (BOOL)_vlcInputItem->b_net; } - (void)subTreeAdded:(input_item_node_t *)p_node @@ -567,15 +451,12 @@ - (int)writeMetadataToFile { - if (!_vlcInputItem) { - return VLC_ENOENT; - } return input_item_WriteMeta(VLC_OBJECT(getIntf()), _vlcInputItem); } - (void)thumbnailWithSize:(NSSize)size completionHandler:(void(^)(NSImage * image))completionHandler { - if (self.isStream || _vlcInputItem == NULL) { + if (self.isStream) { completionHandler(nil); return; } @@ -650,10 +531,6 @@ - (nullable NSArray<NSString *> *)options { - if (_vlcInputItem == NULL) { - return nil; - } - const int i_options = _vlcInputItem->i_options; NSMutableArray * const options = NSMutableArray arrayWithCapacity:i_options; for (NSUInteger i = 0; i < i_options; ++i) {
View file
_service:obs_scm:vlc-beta-20250624.dde35b7bd5.obscpio/modules/gui/macosx/library/media-source/VLCMediaSource.m -> _service:obs_scm:vlc-beta-20250626.14217002b5.obscpio/modules/gui/macosx/library/media-source/VLCMediaSource.m
Changed
@@ -31,6 +31,7 @@ vlc_preparser_t *_p_preparser; vlc_media_source_t *_p_mediaSource; vlc_media_tree_listener_id *_p_treeListenerID; + NSLock *_generateChildNodesLock; } @end @@ -105,6 +106,7 @@ { self = super init; if (self) { + _generateChildNodesLock = NSLock alloc init; _respondsToDiskChanges = NO; _p_preparser = p_preparser; @@ -133,6 +135,7 @@ { self = super init; if (self && p_mediaSource != NULL) { + _generateChildNodesLock = NSLock alloc init; _respondsToDiskChanges = NO; _p_preparser = p_preparser; _p_mediaSource = p_mediaSource; @@ -150,6 +153,7 @@ { self = super init; if (self) { + _generateChildNodesLock = NSLock alloc init; _p_preparser = p_preparser; _p_mediaSource = malloc(sizeof(vlc_media_source_t)); @@ -219,6 +223,7 @@ { self = super init; if (self) { + _generateChildNodesLock = NSLock alloc init; _p_preparser = p_preparser; _p_mediaSource = malloc(sizeof(vlc_media_source_t)); @@ -410,6 +415,8 @@ withUrl:(NSURL *)directoryUrl { NSParameterAssert(directoryNode != NULL && directoryUrl != nil); + _generateChildNodesLock lock; + if (self.willStartGeneratingChildNodesForNodeHandler) { self.willStartGeneratingChildNodesForNodeHandler(directoryNode); } @@ -485,6 +492,7 @@ if (self.didFinishGeneratingChildNodesForNodeHandler) { self.didFinishGeneratingChildNodesForNodeHandler(directoryNode); } + _generateChildNodesLock unlock; return nil; }
View file
_service:obs_scm:vlc-beta-20250624.dde35b7bd5.obscpio/modules/gui/macosx/library/media-source/VLCMediaSourceBaseDataSource.m -> _service:obs_scm:vlc-beta-20250626.14217002b5.obscpio/modules/gui/macosx/library/media-source/VLCMediaSourceBaseDataSource.m
Changed
@@ -488,7 +488,8 @@ return; } - VLCMediaSourceDataSource * const newChildDataSource = VLCMediaSourceDataSource alloc init; + VLCMediaSourceDataSource * const newChildDataSource = + VLCMediaSourceDataSource alloc initWithParentBaseDataSource:self; newChildDataSource.displayedMediaSource = mediaSource; newChildDataSource.nodeToDisplay = node; @@ -496,7 +497,6 @@ newChildDataSource.pathControl = self.pathControl; newChildDataSource.tableView = self.tableView; newChildDataSource.navigationStack = self.navigationStack; - newChildDataSource.parentBaseDataSource = self; self setChildDataSource:newChildDataSource; self.navigationStack appendCurrentLibraryState;
View file
_service:obs_scm:vlc-beta-20250624.dde35b7bd5.obscpio/modules/gui/macosx/library/media-source/VLCMediaSourceDataSource.h -> _service:obs_scm:vlc-beta-20250626.14217002b5.obscpio/modules/gui/macosx/library/media-source/VLCMediaSourceDataSource.h
Changed
@@ -47,6 +47,7 @@ @property (readwrite, weak) VLCLibraryMediaSourceViewNavigationStack *navigationStack; @property (readwrite, weak) VLCMediaSourceBaseDataSource *parentBaseDataSource; +- (instancetype)initWithParentBaseDataSource:(VLCMediaSourceBaseDataSource *)parentBaseDataSource; - (void)setupViews; - (VLCInputItem *)mediaSourceInputItemAtRow:(NSInteger)tableViewRow; - (NSArray<VLCInputItem *> *)mediaSourceInputItemsAtIndexPaths:(NSSet<NSIndexPath *> *const)indexPaths;
View file
_service:obs_scm:vlc-beta-20250624.dde35b7bd5.obscpio/modules/gui/macosx/library/media-source/VLCMediaSourceDataSource.m -> _service:obs_scm:vlc-beta-20250626.14217002b5.obscpio/modules/gui/macosx/library/media-source/VLCMediaSourceDataSource.m
Changed
@@ -62,6 +62,14 @@ @implementation VLCMediaSourceDataSource +- (instancetype)initWithParentBaseDataSource:(VLCMediaSourceBaseDataSource *)parentBaseDataSource +{ + self = super init; + if (self) + self.parentBaseDataSource = parentBaseDataSource; + return self; +} + - (dispatch_source_t)observeLocalUrl:(NSURL *)url forVnodeEvents:(dispatch_source_vnode_flags_t)eventsFlags withEventHandler:(dispatch_block_t)eventHandlerBlock @@ -92,6 +100,7 @@ input_item_node_t * const inputNode = nodeToDisplay.vlcInputItemNode; + NSParameterAssert(self.parentBaseDataSource); if (self.parentBaseDataSource.mediaSourceMode == VLCMediaSourceModeLAN) { NSURL * const nodeUrl = NSURL URLWithString:nodeToDisplay.inputItem.MRL; NSError * const error =
View file
_service:obs_scm:vlc-beta-20250624.dde35b7bd5.obscpio/modules/video_output/opengl/gl_api.c -> _service:obs_scm:vlc-beta-20250626.14217002b5.obscpio/modules/video_output/opengl/gl_api.c
Changed
@@ -202,5 +202,15 @@ api->glsl_version = 120; } + if (api->is_gles) + { + if (api->glsl_version < 300) + api->supports_sampler3D = vlc_gl_HasExtension(&extension_vt, "GL_OES_texture_3D"); + else + api->supports_sampler3D = true; + } + else + api->supports_sampler3D = false; + return VLC_SUCCESS; }
View file
_service:obs_scm:vlc-beta-20250624.dde35b7bd5.obscpio/modules/video_output/opengl/gl_api.h -> _service:obs_scm:vlc-beta-20250626.14217002b5.obscpio/modules/video_output/opengl/gl_api.h
Changed
@@ -46,6 +46,9 @@ /* Multisampling for anti-aliasing */ bool supports_multisample; + + /* sampler3D feature and syntax support */ + bool supports_sampler3D; }; int
View file
_service:obs_scm:vlc-beta-20250624.dde35b7bd5.obscpio/modules/video_output/opengl/sampler.c -> _service:obs_scm:vlc-beta-20250626.14217002b5.obscpio/modules/video_output/opengl/sampler.c
Changed
@@ -581,17 +581,24 @@ const char *ext_yuv_target = "#extension GL_EXT_YUV_target : require\n"; + const char *image_ext = ""; if (tex_target == GL_TEXTURE_EXTERNAL_OES) { if (is_yuv) - sampler->shader.extensions = strdup(ext_yuv_target); + image_ext = ext_yuv_target; else - sampler->shader.extensions = strdup(image_external); - if (!sampler->shader.extensions) - return VLC_EGENERIC; + image_ext = image_external; + } + + int ret = asprintf(&sampler->shader.extensions, + "#extension GL_OES_texture_3D : enable\n" + "%s", image_ext); + if (ret <= 0) + { + if (ret == 0) + FREENULL(sampler->shader.extensions); + return VLC_EGENERIC; } - else - sampler->shader.extensions = NULL; return VLC_SUCCESS; } @@ -1056,16 +1063,14 @@ int glsl_version; if (api->is_gles) { -#define GLES_COMMON_PRECISION \ - "precision highp float;\n" \ - "precision highp sampler2D;\n" \ - "precision highp sampler3D;\n" - if (priv->unsigned_sampler) - sampler->shader.precision = GLES_COMMON_PRECISION - "precision highp usampler2D;\n"; - else - sampler->shader.precision = GLES_COMMON_PRECISION; + if (asprintf(&sampler->shader.precision, + "precision highp float;\n" + "precision highp sampler2D;\n" + "%s%s", + api->supports_sampler3D ? "precision highp sampler3D;\n" : "", + priv->unsigned_sampler ? "precision highp usampler2D;\n" : "" ) <= 0 ) + goto error; if (api->glsl_version >= 300) { sampler->shader.version = strdup("#version 300 es\n"); @@ -1074,8 +1079,12 @@ sampler->shader.version = strdup("#version 100\n"); glsl_version = 100; } + if (!sampler->shader.version) + goto error; } else { - sampler->shader.precision = ""; + sampler->shader.precision = strdup("// no precision\n"); + if (!sampler->shader.precision) + goto error; /* GLSL version 420+ breaks backwards compatibility with pre-GLSL 130 * syntax, which we use in our vertex/fragment shaders. */ glsl_version = __MIN(api->glsl_version, 410); @@ -1160,6 +1169,7 @@ pl_log_destroy(&priv->pl_log); #endif + free(sampler->shader.precision); free(sampler->shader.extensions); free(sampler->shader.body); free(sampler->shader.version);
View file
_service:obs_scm:vlc-beta-20250624.dde35b7bd5.obscpio/modules/video_output/opengl/sampler.h -> _service:obs_scm:vlc-beta-20250626.14217002b5.obscpio/modules/video_output/opengl/sampler.h
Changed
@@ -97,7 +97,7 @@ /** * Precision preamble that is appropriate for this shader. */ - const char *precision; + char *precision; /** * Piece of fragment shader code declaration OpenGL extensions.
View file
_service:obs_scm:vlc-beta-20250624.dde35b7bd5.obscpio/src/win32/filesystem.c -> _service:obs_scm:vlc-beta-20250626.14217002b5.obscpio/src/win32/filesystem.c
Changed
@@ -65,24 +65,46 @@ int vlc_open (const char *filename, int flags, ...) { - int mode = 0; - va_list ap; + DWORD dwDesiredAccess, dwCreationDisposition, dwFlagsAndAttributes; flags |= O_NOINHERIT; /* O_CLOEXEC */ /* Defaults to binary mode */ if ((flags & O_TEXT) == 0) flags |= O_BINARY; - va_start (ap, flags); + if (flags & O_WRONLY) + { + dwDesiredAccess = GENERIC_WRITE; + } + else if (flags & O_RDWR) + { + dwDesiredAccess = GENERIC_READ | GENERIC_WRITE; + } + else // if (flags & O_RDONLY) + { + dwDesiredAccess = GENERIC_READ; + } + if (flags & O_CREAT) { - int unixmode = va_arg(ap, int); - if (unixmode & 0444) - mode |= _S_IREAD; - if (unixmode & 0222) - mode |= _S_IWRITE; + if (flags & O_EXCL) + dwCreationDisposition = CREATE_NEW; + else + dwCreationDisposition = CREATE_ALWAYS; } - va_end (ap); + else if (flags & O_TRUNC) + { + dwCreationDisposition = TRUNCATE_EXISTING; + } + else + { + dwCreationDisposition = OPEN_EXISTING; + } + + dwFlagsAndAttributes = FILE_FLAG_RANDOM_ACCESS | SECURITY_SQOS_PRESENT | SECURITY_IDENTIFICATION; + + // if (flags & O_NONBLOCK) + // dwFlagsAndAttributes |= FILE_FLAG_OVERLAPPED; /* * open() cannot open files with non-“ANSI” characters on Windows. @@ -92,8 +114,31 @@ if (wpath == NULL) return -1; - int fd = _wopen (wpath, flags, mode); + HANDLE h; +#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) + h = CreateFileW(wpath, dwDesiredAccess, + FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, + NULL, dwCreationDisposition, + dwFlagsAndAttributes, NULL); +#else + CREATEFILE2_EXTENDED_PARAMETERS params = { 0 }; + params.dwSize = sizeof(params); + params.dwFileAttributes = dwFlagsAndAttributes & 0xFFFF; + params.dwFileFlags = dwFlagsAndAttributes & ~(0xFFFF | SECURITY_VALID_SQOS_FLAGS); + params.dwSecurityQosFlags = dwFlagsAndAttributes & SECURITY_VALID_SQOS_FLAGS; + h = CreateFile2(wpath, dwDesiredAccess, + FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, + dwCreationDisposition, + ¶ms); +#endif free (wpath); + if (h == INVALID_HANDLE_VALUE) + return -1; + int fd = _open_osfhandle((intptr_t)h, flags); + if (unlikely(fd == -1)) + { + CloseHandle(h); + } return fd; }
View file
_service:obs_scm:vlc-beta-20250624.dde35b7bd5.obscpio/src/win32/spawn.c -> _service:obs_scm:vlc-beta-20250626.14217002b5.obscpio/src/win32/spawn.c
Changed
@@ -116,7 +116,7 @@ char *cmdline = NULL; if (fdv0 == -1 || fdv1 == -1) { - nulfd = vlc_open("\\\\.\\NUL", O_RDWR); + nulfd = _open("\\\\.\\NUL", O_RDWR); if (unlikely(nulfd == -1)) goto error;
View file
_service:obs_scm:vlc-beta.obsinfo
Changed
@@ -1,4 +1,4 @@ name: vlc-beta -version: 20250624.dde35b7bd5 -mtime: 1750738056 -commit: dde35b7bd5ba1c0430b91fd4c129fc1d4e2932ea +version: 20250626.14217002b5 +mtime: 1750929381 +commit: 14217002b528a7334013011d9473a3a4bdf34c75
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.