Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
fa3433e3
Commit
fa3433e3
authored
Feb 21, 2014
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
addons: use predicate on finder thread
changes use of null uri
parent
669c40dc
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
27 deletions
+37
-27
modules/gui/macosx/AddonManager.m
modules/gui/macosx/AddonManager.m
+2
-2
modules/gui/qt4/managers/addons_manager.cpp
modules/gui/qt4/managers/addons_manager.cpp
+1
-1
modules/misc/addons/vorepository.c
modules/misc/addons/vorepository.c
+4
-2
src/misc/addons.c
src/misc/addons.c
+30
-22
No files found.
modules/gui/macosx/AddonManager.m
View file @
fa3433e3
...
...
@@ -279,7 +279,7 @@ static VLCAddonManager *_o_sharedInstance = nil;
-
(
void
)
_findNewAddons
{
[
_spinner
startAnimation
:
nil
];
addons_manager_Gather
(
_manager
,
NULL
);
addons_manager_Gather
(
_manager
,
"repo://"
);
}
/* FIXME: un-used */
...
...
@@ -321,4 +321,4 @@ static VLCAddonManager *_o_sharedInstance = nil;
}
}
@end
\ No newline at end of file
@end
modules/gui/qt4/managers/addons_manager.cpp
View file @
fa3433e3
...
...
@@ -47,7 +47,7 @@ AddonsManager::~AddonsManager()
void
AddonsManager
::
findNewAddons
()
{
addons_manager_Gather
(
p_manager
,
NULL
);
addons_manager_Gather
(
p_manager
,
"repo://"
);
}
void
AddonsManager
::
findDesignatedAddon
(
QString
uri
)
...
...
modules/misc/addons/vorepository.c
View file @
fa3433e3
...
...
@@ -492,8 +492,10 @@ static int Open(vlc_object_t *p_this)
if
(
!
p_finder
->
p_sys
)
return
VLC_ENOMEM
;
p_finder
->
p_sys
->
psz_tempfile
=
NULL
;
/* We only support listing the whole repo */
if
(
p_finder
->
psz_uri
)
if
(
p_finder
->
psz_uri
&&
strcmp
(
"repo://"
ADDONS_MODULE_SHORTCUT
,
p_finder
->
psz_uri
)
&&
memcmp
(
"repo://"
,
p_finder
->
psz_uri
,
8
)
)
return
VLC_EGENERIC
;
p_finder
->
pf_find
=
Find
;
...
...
src/misc/addons.c
View file @
fa3433e3
...
...
@@ -51,7 +51,7 @@ struct addons_manager_private_t
vlc_cond_t
waitcond
;
bool
b_live
;
vlc_mutex_t
lock
;
char
*
psz_uri_hint
;
/* uri hint for non repo based install */
DECL_ARRAY
(
char
*
)
uris
;
DECL_ARRAY
(
addon_entry_t
*
)
entries
;
}
finder
;
...
...
@@ -154,7 +154,7 @@ addons_manager_t *addons_manager_New( vlc_object_t *p_this )
INIT_QUEUE
(
finder
)
INIT_QUEUE
(
installer
)
p_manager
->
p_priv
->
finder
.
psz_uri_hint
=
NULL
;
ARRAY_INIT
(
p_manager
->
p_priv
->
finder
.
uris
)
;
vlc_event_manager_t
*
em
=
p_manager
->
p_event_manager
;
vlc_event_manager_init
(
em
,
p_manager
);
...
...
@@ -201,7 +201,10 @@ void addons_manager_Delete( addons_manager_t *p_manager )
FREE_QUEUE
(
finder
)
FREE_QUEUE
(
installer
)
free
(
p_manager
->
p_priv
->
finder
.
psz_uri_hint
);
FOREACH_ARRAY
(
char
*
psz_uri
,
p_manager
->
p_priv
->
finder
.
uris
)
free
(
psz_uri
);
FOREACH_END
();
ARRAY_RESET
(
p_manager
->
p_priv
->
finder
.
uris
);
free
(
p_manager
->
p_priv
);
free
(
p_manager
->
p_event_manager
);
...
...
@@ -210,11 +213,13 @@ void addons_manager_Delete( addons_manager_t *p_manager )
void
addons_manager_Gather
(
addons_manager_t
*
p_manager
,
const
char
*
psz_uri
)
{
if
(
!
psz_uri
)
return
;
vlc_mutex_lock
(
&
p_manager
->
p_priv
->
finder
.
lock
);
if
(
psz_uri
)
{
p_manager
->
p_priv
->
finder
.
psz_uri_hint
=
strdup
(
psz_uri
);
}
ARRAY_APPEND
(
p_manager
->
p_priv
->
finder
.
uris
,
strdup
(
psz_uri
)
);
if
(
!
p_manager
->
p_priv
->
finder
.
b_live
)
{
if
(
vlc_clone
(
&
p_manager
->
p_priv
->
finder
.
thread
,
FinderThread
,
p_manager
,
...
...
@@ -226,13 +231,10 @@ void addons_manager_Gather( addons_manager_t *p_manager, const char *psz_uri )
return
;
}
p_manager
->
p_priv
->
finder
.
b_live
=
true
;
vlc_mutex_unlock
(
&
p_manager
->
p_priv
->
finder
.
lock
);
}
else
{
vlc_mutex_unlock
(
&
p_manager
->
p_priv
->
finder
.
lock
);
vlc_cond_signal
(
&
p_manager
->
p_priv
->
finder
.
waitcond
);
}
vlc_mutex_unlock
(
&
p_manager
->
p_priv
->
finder
.
lock
);
vlc_cond_signal
(
&
p_manager
->
p_priv
->
finder
.
waitcond
);
}
/*****************************************************************************
...
...
@@ -305,6 +307,7 @@ static void LoadLocalStorage( addons_manager_t *p_manager )
if
(
p_module
)
{
ARRAY_INIT
(
p_finder
->
entries
);
p_finder
->
psz_uri
=
NULL
;
p_finder
->
pf_find
(
p_finder
);
module_unneed
(
p_finder
,
p_module
);
...
...
@@ -319,9 +322,21 @@ static void *FinderThread( void *p_data )
{
addons_manager_t
*
p_manager
=
p_data
;
int
i_cancel
;
char
*
psz_uri
;
for
(
;;
)
{
vlc_mutex_lock
(
&
p_manager
->
p_priv
->
finder
.
lock
);
vlc_cleanup_push
(
vlc_mutex_unlock
,
&
p_manager
->
p_priv
->
finder
.
lock
);
while
(
p_manager
->
p_priv
->
finder
.
uris
.
i_size
==
0
)
{
vlc_cond_wait
(
&
p_manager
->
p_priv
->
finder
.
waitcond
,
&
p_manager
->
p_priv
->
finder
.
lock
);
}
psz_uri
=
p_manager
->
p_priv
->
finder
.
uris
.
p_elems
[
0
];
ARRAY_REMOVE
(
p_manager
->
p_priv
->
finder
.
uris
,
0
);
vlc_cleanup_run
();
addons_finder_t
*
p_finder
=
vlc_custom_create
(
p_manager
->
p_priv
->
p_parent
,
sizeof
(
*
p_finder
),
"entries finder"
);
...
...
@@ -331,8 +346,7 @@ static void *FinderThread( void *p_data )
module_t
*
p_module
;
ARRAY_INIT
(
p_finder
->
entries
);
vlc_mutex_lock
(
&
p_manager
->
p_priv
->
finder
.
lock
);
p_finder
->
psz_uri
=
p_manager
->
p_priv
->
finder
.
psz_uri_hint
;
p_manager
->
p_priv
->
finder
.
psz_uri_hint
=
NULL
;
p_finder
->
psz_uri
=
psz_uri
;
vlc_mutex_unlock
(
&
p_manager
->
p_priv
->
finder
.
lock
);
p_module
=
module_need
(
p_finder
,
"addons finder"
,
NULL
,
false
);
...
...
@@ -343,7 +357,7 @@ static void *FinderThread( void *p_data )
MergeSources
(
p_manager
,
p_finder
->
entries
.
p_elems
,
p_finder
->
entries
.
i_size
);
}
ARRAY_RESET
(
p_finder
->
entries
);
free
(
p
_finder
->
p
sz_uri
);
free
(
psz_uri
);
vlc_object_release
(
p_finder
);
}
...
...
@@ -354,12 +368,6 @@ static void *FinderThread( void *p_data )
vlc_restorecancel
(
i_cancel
);
vlc_testcancel
();
vlc_mutex_lock
(
&
p_manager
->
p_priv
->
finder
.
lock
);
vlc_cleanup_push
(
vlc_mutex_unlock
,
&
p_manager
->
p_priv
->
finder
.
lock
);
vlc_cond_wait
(
&
p_manager
->
p_priv
->
finder
.
waitcond
,
&
p_manager
->
p_priv
->
finder
.
lock
);
vlc_cleanup_run
();
}
return
NULL
;
...
...
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