Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
9b34074c
Commit
9b34074c
authored
May 23, 2011
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated update code to vlc_clone().
parent
f818952f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
20 deletions
+19
-20
src/misc/update.c
src/misc/update.c
+15
-19
src/misc/update.h
src/misc/update.h
+4
-1
No files found.
src/misc/update.c
View file @
9b34074c
...
...
@@ -130,15 +130,14 @@ void update_Delete( update_t *p_update )
if
(
p_update
->
p_check
)
{
vlc_object_kill
(
p_update
->
p_check
);
vlc_thread_join
(
p_update
->
p_check
);
vlc_object_release
(
p_update
->
p_check
);
vlc_join
(
p_update
->
p_check
->
thread
,
NULL
);
free
(
p_update
->
p_check
);
}
if
(
p_update
->
p_download
)
{
vlc_object_kill
(
p_update
->
p_download
);
vlc_
thread_join
(
p_update
->
p_download
);
vlc_
join
(
p_update
->
p_download
->
thread
,
NULL
);
vlc_object_release
(
p_update
->
p_download
);
}
...
...
@@ -373,7 +372,7 @@ error:
return
false
;
}
static
void
*
update_CheckReal
(
v
lc_object_t
*
p_this
);
static
void
*
update_CheckReal
(
v
oid
*
);
/**
* Check for updates
...
...
@@ -390,14 +389,11 @@ void update_Check( update_t *p_update, void (*pf_callback)( void*, bool ), void
// If the object already exist, destroy it
if
(
p_update
->
p_check
)
{
vlc_object_kill
(
p_update
->
p_check
);
vlc_thread_join
(
p_update
->
p_check
);
vlc_object_release
(
p_update
->
p_check
);
vlc_join
(
p_update
->
p_check
->
thread
,
NULL
);
free
(
p_update
->
p_check
);
}
update_check_thread_t
*
p_uct
=
vlc_custom_create
(
p_update
->
p_libvlc
,
sizeof
(
*
p_uct
),
VLC_OBJECT_GENERIC
,
"update check"
);
update_check_thread_t
*
p_uct
=
calloc
(
1
,
sizeof
(
*
p_uct
)
);
if
(
!
p_uct
)
return
;
p_uct
->
p_update
=
p_update
;
...
...
@@ -405,12 +401,12 @@ void update_Check( update_t *p_update, void (*pf_callback)( void*, bool ), void
p_uct
->
pf_callback
=
pf_callback
;
p_uct
->
p_data
=
p_data
;
vlc_
thread_create
(
p_uct
,
update_CheckReal
,
VLC_THREAD_PRIORITY_LOW
);
vlc_
clone
(
&
p_uct
->
thread
,
update_CheckReal
,
p_uct
,
VLC_THREAD_PRIORITY_LOW
);
}
void
*
update_CheckReal
(
v
lc_object_t
*
p_this
)
void
*
update_CheckReal
(
v
oid
*
obj
)
{
update_check_thread_t
*
p_uct
=
(
update_check_thread_t
*
)
p_this
;
update_check_thread_t
*
p_uct
=
(
update_check_thread_t
*
)
obj
;
bool
b_ret
;
int
canc
;
...
...
@@ -486,7 +482,7 @@ static char *size_str( long int l_size )
return
i_retval
==
-
1
?
NULL
:
psz_tmp
;
}
static
void
*
update_DownloadReal
(
v
lc_object_t
*
p_this
);
static
void
*
update_DownloadReal
(
v
oid
*
);
/**
* Download the file given in the update_t
...
...
@@ -503,7 +499,7 @@ void update_Download( update_t *p_update, const char *psz_destdir )
if
(
p_update
->
p_download
)
{
vlc_object_kill
(
p_update
->
p_download
);
vlc_
thread_join
(
p_update
->
p_download
);
vlc_
join
(
p_update
->
p_download
->
thread
,
NULL
);
vlc_object_release
(
p_update
->
p_download
);
}
...
...
@@ -517,12 +513,12 @@ void update_Download( update_t *p_update, const char *psz_destdir )
p_update
->
p_download
=
p_udt
;
p_udt
->
psz_destdir
=
psz_destdir
?
strdup
(
psz_destdir
)
:
NULL
;
vlc_
thread_create
(
p_udt
,
update_DownloadReal
,
VLC_THREAD_PRIORITY_LOW
);
vlc_
clone
(
&
p_udt
->
thread
,
update_DownloadReal
,
p_udt
,
VLC_THREAD_PRIORITY_LOW
);
}
static
void
*
update_DownloadReal
(
v
lc_object_t
*
p_this
)
static
void
*
update_DownloadReal
(
v
oid
*
obj
)
{
update_download_thread_t
*
p_udt
=
(
update_download_thread_t
*
)
p_this
;
update_download_thread_t
*
p_udt
=
(
update_download_thread_t
*
)
obj
;
dialog_progress_bar_t
*
p_progress
=
NULL
;
long
int
l_size
;
long
int
l_downloaded
=
0
;
...
...
src/misc/update.h
View file @
9b34074c
...
...
@@ -150,6 +150,8 @@ typedef struct public_key_t public_key_t;
typedef
struct
{
VLC_COMMON_MEMBERS
vlc_thread_t
thread
;
update_t
*
p_update
;
char
*
psz_destdir
;
}
update_download_thread_t
;
...
...
@@ -159,7 +161,8 @@ typedef struct
*/
typedef
struct
{
VLC_COMMON_MEMBERS
vlc_thread_t
thread
;
update_t
*
p_update
;
void
(
*
pf_callback
)(
void
*
,
bool
);
void
*
p_data
;
...
...
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