Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
31d471de
Commit
31d471de
authored
Aug 21, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
preparser: use vlc_object_t instead of playlist_t
parent
f6671b3e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
24 deletions
+21
-24
src/playlist/engine.c
src/playlist/engine.c
+5
-9
src/playlist/preparser.c
src/playlist/preparser.c
+14
-14
src/playlist/preparser.h
src/playlist/preparser.h
+2
-1
No files found.
src/playlist/engine.c
View file @
31d471de
...
...
@@ -239,16 +239,12 @@ playlist_t * playlist_Create( vlc_object_t *p_parent )
/* Fetcher */
p
->
p_fetcher
=
playlist_fetcher_New
(
VLC_OBJECT
(
p_playlist
)
);
if
(
unlikely
(
p
->
p_fetcher
==
NULL
)
)
{
msg_Err
(
p_playlist
,
"cannot create fetcher"
);
p
->
p_preparser
=
NULL
;
}
else
{
/* Preparse */
p
->
p_preparser
=
playlist_preparser_New
(
p_playlist
,
p
->
p_fetcher
);
if
(
unlikely
(
p
->
p_preparser
==
NULL
)
)
msg_Err
(
p_playlist
,
"cannot create preparser"
);
}
/* Preparser */
p
->
p_preparser
=
playlist_preparser_New
(
VLC_OBJECT
(
p_playlist
),
p
->
p_fetcher
);
if
(
unlikely
(
p
->
p_preparser
==
NULL
)
)
msg_Err
(
p_playlist
,
"cannot create preparser"
);
/* Create the root node */
PL_LOCK
;
...
...
src/playlist/preparser.c
View file @
31d471de
...
...
@@ -39,7 +39,7 @@
*****************************************************************************/
struct
playlist_preparser_t
{
playlist_t
*
p_playlis
t
;
vlc_object_t
*
objec
t
;
playlist_fetcher_t
*
p_fetcher
;
vlc_mutex_t
lock
;
...
...
@@ -56,18 +56,19 @@ static void *Thread( void * );
/*****************************************************************************
* Public functions
*****************************************************************************/
playlist_preparser_t
*
playlist_preparser_New
(
playlist_t
*
p_playlist
,
playlist_fetcher_t
*
p_fetcher
)
playlist_preparser_t
*
playlist_preparser_New
(
vlc_object_t
*
parent
,
playlist_fetcher_t
*
p_fetcher
)
{
playlist_preparser_t
*
p_preparser
=
malloc
(
sizeof
(
*
p_preparser
)
);
if
(
!
p_preparser
)
return
NULL
;
p_preparser
->
p_playlist
=
p_playlis
t
;
p_preparser
->
object
=
paren
t
;
p_preparser
->
p_fetcher
=
p_fetcher
;
vlc_mutex_init
(
&
p_preparser
->
lock
);
vlc_cond_init
(
&
p_preparser
->
wait
);
p_preparser
->
b_live
=
false
;
p_preparser
->
i_art_policy
=
var_
GetInteger
(
p_playlis
t
,
"album-art"
);
p_preparser
->
i_art_policy
=
var_
InheritInteger
(
paren
t
,
"album-art"
);
p_preparser
->
i_waiting
=
0
;
p_preparser
->
pp_waiting
=
NULL
;
...
...
@@ -85,8 +86,7 @@ void playlist_preparser_Push( playlist_preparser_t *p_preparser, input_item_t *p
{
if
(
vlc_clone_detach
(
NULL
,
Thread
,
p_preparser
,
VLC_THREAD_PRIORITY_LOW
)
)
msg_Warn
(
p_preparser
->
p_playlist
,
"cannot spawn pre-parser thread"
);
msg_Warn
(
p_preparser
->
object
,
"cannot spawn pre-parser thread"
);
else
p_preparser
->
b_live
=
true
;
}
...
...
@@ -119,7 +119,7 @@ void playlist_preparser_Delete( playlist_preparser_t *p_preparser )
/**
* This function preparses an item when needed.
*/
static
void
Preparse
(
playlist_t
*
p_playlist
,
input_item_t
*
p_item
)
static
void
Preparse
(
vlc_object_t
*
obj
,
input_item_t
*
p_item
)
{
vlc_mutex_lock
(
&
p_item
->
lock
);
int
i_type
=
p_item
->
i_type
;
...
...
@@ -134,10 +134,10 @@ static void Preparse( playlist_t *p_playlist, input_item_t *p_item )
/* Do not preparse if it is already done (like by playing it) */
if
(
!
input_item_IsPreparsed
(
p_item
)
)
{
input_Preparse
(
VLC_OBJECT
(
p_playlist
)
,
p_item
);
input_Preparse
(
obj
,
p_item
);
input_item_SetPreparsed
(
p_item
,
true
);
var_SetAddress
(
p_playlist
,
"item-change"
,
p_item
);
var_SetAddress
(
obj
,
"item-change"
,
p_item
);
}
}
...
...
@@ -146,7 +146,7 @@ static void Preparse( playlist_t *p_playlist, input_item_t *p_item )
*/
static
void
Art
(
playlist_preparser_t
*
p_preparser
,
input_item_t
*
p_item
)
{
playlist_t
*
p_playlist
=
p_preparser
->
p_playlis
t
;
vlc_object_t
*
obj
=
p_preparser
->
objec
t
;
playlist_fetcher_t
*
p_fetcher
=
p_preparser
->
p_fetcher
;
bool
b_fetch
=
false
;
...
...
@@ -167,13 +167,13 @@ static void Art( playlist_preparser_t *p_preparser, input_item_t *p_item )
(
strncmp
(
psz_arturl
,
"file://"
,
7
)
&&
strncmp
(
psz_arturl
,
"attachment://"
,
13
)
)
)
)
{
msg_Dbg
(
p_playlist
,
"meta ok for %s, need to fetch art"
,
msg_Dbg
(
obj
,
"meta ok for %s, need to fetch art"
,
psz_name
?
psz_name
:
"(null)"
);
b_fetch
=
true
;
}
else
{
msg_Dbg
(
p_playlist
,
"no fetch required for %s (art currently %s)"
,
msg_Dbg
(
obj
,
"no fetch required for %s (art currently %s)"
,
psz_name
?
psz_name
:
"(null)"
,
psz_arturl
?
psz_arturl
:
"(null)"
);
}
...
...
@@ -190,7 +190,7 @@ static void Art( playlist_preparser_t *p_preparser, input_item_t *p_item )
static
void
*
Thread
(
void
*
data
)
{
playlist_preparser_t
*
p_preparser
=
data
;
playlist_t
*
p_playlist
=
p_preparser
->
p_playlis
t
;
vlc_object_t
*
obj
=
p_preparser
->
objec
t
;
for
(
;;
)
{
...
...
@@ -214,7 +214,7 @@ static void *Thread( void *data )
if
(
!
p_current
)
break
;
Preparse
(
p_playlist
,
p_current
);
Preparse
(
obj
,
p_current
);
Art
(
p_preparser
,
p_current
);
vlc_gc_decref
(
p_current
);
...
...
src/playlist/preparser.h
View file @
31d471de
...
...
@@ -37,7 +37,8 @@ typedef struct playlist_preparser_t playlist_preparser_t;
/**
* This function creates the preparser object and thread.
*/
playlist_preparser_t
*
playlist_preparser_New
(
playlist_t
*
,
playlist_fetcher_t
*
);
playlist_preparser_t
*
playlist_preparser_New
(
vlc_object_t
*
,
playlist_fetcher_t
*
);
/**
* This function enqueues the provided item to be preparsed.
...
...
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