Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
VideoLAN
medialibrary
Commits
9ba0ea93
Commit
9ba0ea93
authored
Sep 29, 2015
by
Hugo Beauzée-Luyssen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MediaLibrary: Make discovery asynchronous
parent
337cd9b7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
3 deletions
+9
-3
include/IMediaLibrary.h
include/IMediaLibrary.h
+1
-1
src/MediaLibrary.cpp
src/MediaLibrary.cpp
+8
-2
No files found.
include/IMediaLibrary.h
View file @
9ba0ea93
...
...
@@ -60,7 +60,7 @@ class IMediaLibrary
/**
* @brief discover Launch a discovery on the provided entry point.
* The
re no garanty on how this will be processed, or if it will be processed synchronously or not
.
* The
actuall discovery will run asynchronously, meaning this method will immediatly return
.
* Depending on which discoverer modules where provided, this might or might not work
* @param entryPoint What to discover.
*/
...
...
src/MediaLibrary.cpp
View file @
9ba0ea93
...
...
@@ -217,8 +217,14 @@ void MediaLibrary::addMetadataService(std::unique_ptr<IMetadataService> service)
void
MediaLibrary
::
discover
(
const
std
::
string
&
entryPoint
)
{
for
(
auto
&
d
:
m_discoverers
)
d
->
discover
(
entryPoint
);
std
::
thread
t
([
this
,
entryPoint
]
{
//FIXME: This will crash if the media library gets deleted while we
//are discovering.
for
(
auto
&
d
:
m_discoverers
)
d
->
discover
(
entryPoint
);
}
);
t
.
detach
();
}
FolderPtr
MediaLibrary
::
onNewFolder
(
const
fs
::
IDirectory
*
directory
,
FolderPtr
parent
)
...
...
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