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
bd6930e4
Commit
bd6930e4
authored
Aug 23, 2009
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
art_finder_t: custom type for art finder modules
parent
2858f56a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
58 additions
and
18 deletions
+58
-18
include/vlc_art_finder.h
include/vlc_art_finder.h
+30
-0
modules/meta_engine/folder.c
modules/meta_engine/folder.c
+3
-1
modules/misc/lua/meta.c
modules/misc/lua/meta.c
+3
-1
src/playlist/fetcher.c
src/playlist/fetcher.c
+22
-16
No files found.
include/vlc_art_finder.h
0 → 100644
View file @
bd6930e4
/*****************************************************************************
* vlc_art_finder.h
*****************************************************************************
* Copyright (C) 2009 Rémi Denis-Courmont
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef VLC_ART_FINDER_H
#define VLC_ART_FINDER_H 1
typedef
struct
art_finder_t
{
VLC_COMMON_MEMBERS
input_item_t
*
p_item
;
}
art_finder_t
;
#endif
modules/meta_engine/folder.c
View file @
bd6930e4
...
...
@@ -32,6 +32,7 @@
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_playlist.h>
#include <vlc_art_finder.h>
#include <vlc_charset.h>
#include <vlc_url.h>
...
...
@@ -74,7 +75,8 @@ vlc_module_end ()
*****************************************************************************/
static
int
FindMeta
(
vlc_object_t
*
p_this
)
{
input_item_t
*
p_item
=
(
input_item_t
*
)
p_this
->
p_private
;
art_finder_t
*
p_finder
=
(
art_finder_t
*
)
p_this
;
input_item_t
*
p_item
=
p_finder
->
p_item
;
bool
b_have_art
=
false
;
int
i
;
...
...
modules/misc/lua/meta.c
View file @
bd6930e4
...
...
@@ -37,6 +37,7 @@
#include <vlc_input.h>
#include <vlc_playlist.h>
#include <vlc_meta.h>
#include <vlc_art_finder.h>
#include <vlc_url.h>
#include <vlc_strings.h>
#include <vlc_stream.h>
...
...
@@ -191,11 +192,12 @@ static int fetch_art( vlc_object_t *p_this, const char * psz_filename,
*****************************************************************************/
int
FindArt
(
vlc_object_t
*
p_this
)
{
art_finder_t
*
p_finder
=
(
art_finder_t
*
)
p_this
;
input_item_t
*
p_item
=
p_finder
->
p_item
;
playlist_t
*
p_playlist
=
pl_Hold
(
p_this
);
if
(
!
p_playlist
)
return
VLC_EGENERIC
;
input_item_t
*
p_item
=
(
input_item_t
*
)
p_this
->
p_private
;
lua_State
*
L
=
vlclua_meta_init
(
p_this
,
p_item
);
int
i_ret
=
vlclua_scripts_batch_execute
(
p_this
,
"meta"
,
&
fetch_art
,
L
,
p_item
);
lua_close
(
L
);
...
...
src/playlist/fetcher.c
View file @
bd6930e4
...
...
@@ -29,6 +29,7 @@
#include <vlc_playlist.h>
#include <vlc_stream.h>
#include <limits.h>
#include <vlc_art_finder.h>
#include "art.h"
#include "fetcher.h"
...
...
@@ -138,12 +139,10 @@ void playlist_fetcher_Delete( playlist_fetcher_t *p_fetcher )
static
int
FindArt
(
playlist_fetcher_t
*
p_fetcher
,
input_item_t
*
p_item
)
{
int
i_ret
;
module_t
*
p_module
;
char
*
psz_title
,
*
psz_artist
,
*
psz_album
;
psz_artist
=
input_item_GetArtist
(
p_item
);
psz_album
=
input_item_GetAlbum
(
p_item
);
psz_title
=
input_item_GetTitle
(
p_item
);
char
*
psz_artist
=
input_item_GetArtist
(
p_item
);
char
*
psz_album
=
input_item_GetAlbum
(
p_item
);
char
*
psz_title
=
input_item_GetTitle
(
p_item
);
if
(
!
psz_title
)
psz_title
=
input_item_GetName
(
p_item
);
...
...
@@ -219,19 +218,26 @@ static int FindArt( playlist_fetcher_t *p_fetcher, input_item_t *p_item )
}
/* Fetch the art url */
p_fetcher
->
p_private
=
p_item
;
p_module
=
module_need
(
p_fetcher
,
"art finder"
,
NULL
,
false
);
i_ret
=
VLC_EGENERIC
;
if
(
p_module
)
{
module_unneed
(
p_fetcher
,
p_module
);
i_ret
=
1
;
}
else
vlc_object_t
*
p_parent
=
VLC_OBJECT
(
p_fetcher
->
p_playlist
);
art_finder_t
*
p_finder
=
vlc_custom_create
(
p_parent
,
sizeof
(
*
p_finder
),
VLC_OBJECT_GENERIC
,
"art finder"
);
if
(
p_finder
!=
NULL
)
{
msg_Dbg
(
p_fetcher
,
"unable to find art"
);
i_ret
=
VLC_EGENERIC
;
module_t
*
p_module
;
vlc_object_attach
(
p_finder
,
p_parent
);
p_finder
->
p_item
=
p_item
;
p_module
=
module_need
(
p_parent
,
"art finder"
,
NULL
,
false
);
if
(
p_module
)
{
module_unneed
(
p_finder
,
p_module
);
i_ret
=
1
;
}
vlc_object_release
(
p_finder
);
}
/* Record this album */
...
...
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