Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
VideoLAN
medialibrary
Commits
4ac7c161
Commit
4ac7c161
authored
Oct 29, 2015
by
Hugo Beauzée-Luyssen
Browse files
VLCThumbnailer: Fix error detection
parent
6f89d1b1
Changes
1
Show whitespace changes
Inline
Side-by-side
src/metadata_services/vlc/VLCThumbnailer.cpp
View file @
4ac7c161
...
...
@@ -144,13 +144,10 @@ void VLCThumbnailer::run(std::shared_ptr<Media> file, void *data )
bool
VLCThumbnailer
::
startPlayback
(
std
::
shared_ptr
<
Media
>
file
,
VLC
::
MediaPlayer
&
mp
,
void
*
data
)
{
bool
failed
=
true
;
std
::
unique_lock
<
std
::
mutex
>
lock
(
m_mutex
);
mp
.
eventManager
().
onPlaying
([
this
,
&
failed
]()
{
mp
.
eventManager
().
onPlaying
([
this
]()
{
std
::
unique_lock
<
std
::
mutex
>
lock
(
m_mutex
);
failed
=
false
;
m_cond
.
notify_all
();
});
mp
.
eventManager
().
onEncounteredError
([
this
]()
{
...
...
@@ -159,9 +156,10 @@ bool VLCThumbnailer::startPlayback(std::shared_ptr<Media> file, VLC::MediaPlayer
});
mp
.
play
();
bool
success
=
m_cond
.
wait_for
(
lock
,
std
::
chrono
::
seconds
(
3
),
[
&
mp
]()
{
return
mp
.
state
()
==
libvlc_Playing
||
mp
.
state
()
==
libvlc_Error
;
auto
s
=
mp
.
state
();
return
s
==
libvlc_Playing
||
s
==
libvlc_Error
||
s
==
libvlc_Ended
;
});
if
(
success
==
false
||
failed
==
true
)
if
(
success
==
false
||
mp
.
state
()
==
libvlc_Error
||
mp
.
state
()
==
libvlc_Ended
)
{
// In case of timeout or error, don't go any further
m_cb
->
done
(
file
,
Status
::
Error
,
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