Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
45c3c5f4
Commit
45c3c5f4
authored
Aug 10, 2008
by
Pierre d'Herbemont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update: Various fixes to make it work on Mac OS X.
parent
e7d43dd4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
1 deletion
+31
-1
include/vlc_update.h
include/vlc_update.h
+1
-0
modules/gui/macosx/update.m
modules/gui/macosx/update.m
+4
-1
src/libvlccore.sym
src/libvlccore.sym
+1
-0
src/misc/update.c
src/misc/update.c
+25
-0
No files found.
include/vlc_update.h
View file @
45c3c5f4
...
...
@@ -59,6 +59,7 @@ VLC_EXPORT( void, update_Check, ( update_t *, void (*callback)( void*, bool ), v
VLC_EXPORT
(
bool
,
update_NeedUpgrade
,
(
update_t
*
)
);
VLC_EXPORT
(
void
,
update_Download
,
(
update_t
*
,
const
char
*
)
);
VLC_EXPORT
(
update_release_t
*
,
update_GetRelease
,
(
update_t
*
)
);
VLC_EXPORT
(
void
,
update_WaitDownload
,
(
update_t
*
)
);
/**
* @}
...
...
modules/gui/macosx/update.m
View file @
45c3c5f4
...
...
@@ -151,7 +151,7 @@ static VLCUpdate *_o_sharedInstance = nil;
if
(
returnCode
==
NSOKButton
)
{
/* perform download and pass the selected path */
[
self
performDownload
:
[
sheet
filename
]];
[
NSThread
detachNewThreadSelector
:
@selector
(
performDownload
:)
toTarget
:
self
withObject
:
[
sheet
filename
]];
}
[
sheet
release
];
}
...
...
@@ -215,11 +215,14 @@ static void updateCallback( void * p_data, bool b_success )
-
(
void
)
performDownload
:(
NSString
*
)
path
{
NSAutoreleasePool
*
pool
=
[[
NSAutoreleasePool
alloc
]
init
];
update_Download
(
p_u
,
[
path
UTF8String
]
);
[
o_btn_DownloadNow
setEnabled
:
NO
];
[
o_update_window
orderOut
:
self
];
update_WaitDownload
(
p_u
);
update_Delete
(
p_u
);
p_u
=
nil
;
[
pool
release
];
}
@end
...
...
src/libvlccore.sym
View file @
45c3c5f4
...
...
@@ -362,6 +362,7 @@ update_Download
update_GetRelease
update_NeedUpgrade
__update_New
update_WaitDownload
us_atof
us_strtod
utf8_fopen
...
...
src/misc/update.c
View file @
45c3c5f4
...
...
@@ -1456,6 +1456,14 @@ static char *size_str( long int l_size )
return
i_retval
==
-
1
?
NULL
:
psz_tmp
;
}
void
update_WaitDownload
(
update_t
*
p_update
)
{
if
(
p_update
->
p_download
)
vlc_thread_join
(
p_update
->
p_download
);
vlc_object_release
(
p_update
->
p_download
);
p_update
->
p_download
=
NULL
;
}
static
void
*
update_DownloadReal
(
vlc_object_t
*
p_this
);
/**
...
...
@@ -1504,6 +1512,8 @@ static void* update_DownloadReal( vlc_object_t *p_this )
update_t
*
p_update
=
p_udt
->
p_update
;
char
*
psz_destdir
=
p_udt
->
psz_destdir
;
msg_Dbg
(
p_udt
,
"Opening Stream '%s'"
,
p_update
->
release
.
psz_url
);
/* Open the stream */
p_stream
=
stream_UrlNew
(
p_udt
,
p_update
->
release
.
psz_url
);
if
(
!
p_stream
)
...
...
@@ -1536,7 +1546,12 @@ static void* update_DownloadReal( vlc_object_t *p_this )
/* Create a buffer and fill it with the downloaded file */
p_buffer
=
(
void
*
)
malloc
(
1
<<
10
);
if
(
!
p_buffer
)
{
msg_Err
(
p_udt
,
"Can't malloc (1 << 10) bytes! download cancelled."
);
goto
end
;
}
msg_Dbg
(
p_udt
,
"Downloading Stream '%s'"
,
p_update
->
release
.
psz_url
);
psz_size
=
size_str
(
l_size
);
if
(
asprintf
(
&
psz_status
,
"%s
\n
Downloading... O.O/%s %.1f%% done"
,
...
...
@@ -1585,6 +1600,7 @@ static void* update_DownloadReal( vlc_object_t *p_this )
p_update
->
release
.
psz_url
,
psz_size
)
!=
-
1
)
{
intf_ProgressUpdate
(
p_udt
,
i_progress
,
psz_status
,
100
.
0
,
0
);
i_progress
=
0
;
free
(
psz_status
);
}
}
...
...
@@ -1674,6 +1690,10 @@ static void* update_DownloadReal( vlc_object_t *p_this )
free
(
p_hash
);
end:
if
(
i_progress
)
{
intf_ProgressUpdate
(
p_udt
,
i_progress
,
"Cancelled"
,
100
.
0
,
0
);
}
if
(
p_stream
)
stream_Delete
(
p_stream
);
if
(
p_file
)
...
...
@@ -1715,6 +1735,11 @@ bool update_NeedUpgrade( update_t *p_update )
return
false
;
}
void
update_WaitDownload
(
update_t
*
p_update
)
{
(
void
)
p_update
;
}
void
update_Download
(
update_t
*
p_update
,
const
char
*
psz_destdir
)
{
(
void
)
p_update
;
(
void
)
psz_destdir
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment