Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
VideoLAN
medialibrary
Commits
307bb3ba
Commit
307bb3ba
authored
Oct 22, 2015
by
Hugo Beauzée-Luyssen
Browse files
VLCMetadataService: Don't run on an already processed file
parent
25213b7c
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/metadata_services/vlc/VLCMetadataService.cpp
View file @
307bb3ba
...
...
@@ -52,6 +52,12 @@ unsigned int VLCMetadataService::priority() const
void
VLCMetadataService
::
run
(
std
::
shared_ptr
<
Media
>
file
,
void
*
data
)
{
if
(
file
->
duration
()
!=
-
1
)
{
LOG_INFO
(
file
->
mrl
(),
" was already parsed"
);
m_cb
->
done
(
file
,
Status
::
Success
,
data
);
return
;
}
LOG_INFO
(
"Parsing "
,
file
->
mrl
()
);
auto
ctx
=
new
Context
(
file
);
...
...
@@ -107,8 +113,6 @@ IMetadataService::Status VLCMetadataService::handleMediaMeta( std::shared_ptr<Me
track
.
channels
()
);
}
}
auto
duration
=
vlcMedia
.
duration
();
media
->
setDuration
(
duration
);
if
(
isAudio
==
true
)
{
if
(
parseAudioFile
(
media
,
vlcMedia
)
==
false
)
...
...
@@ -119,6 +123,9 @@ IMetadataService::Status VLCMetadataService::handleMediaMeta( std::shared_ptr<Me
if
(
parseVideoFile
(
media
,
vlcMedia
)
==
false
)
return
Status
::
Fatal
;
}
auto
duration
=
vlcMedia
.
duration
();
if
(
media
->
setDuration
(
duration
)
==
false
)
return
Status
::
Error
;
return
Status
::
Success
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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