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
99a19a8f
Commit
99a19a8f
authored
Dec 31, 2013
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
playlist: hide fetcher underneath the preparser and simplify
parent
804defcc
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
19 deletions
+22
-19
src/playlist/control.c
src/playlist/control.c
+2
-3
src/playlist/engine.c
src/playlist/engine.c
+2
-9
src/playlist/playlist_internal.h
src/playlist/playlist_internal.h
+0
-2
src/playlist/preparser.c
src/playlist/preparser.c
+15
-3
src/playlist/preparser.h
src/playlist/preparser.h
+3
-2
No files found.
src/playlist/control.c
View file @
99a19a8f
...
...
@@ -179,9 +179,8 @@ int playlist_AskForArtEnqueue( playlist_t *p_playlist, input_item_t *p_item )
{
playlist_private_t
*
p_sys
=
pl_priv
(
p_playlist
);
if
(
unlikely
(
p_sys
->
p_
fetch
er
==
NULL
)
)
if
(
unlikely
(
p_sys
->
p_
prepars
er
==
NULL
)
)
return
VLC_ENOMEM
;
playlist_
fetcher_Push
(
p_sys
->
p_fetch
er
,
p_item
);
playlist_
preparser_fetcher_Push
(
p_sys
->
p_prepars
er
,
p_item
);
return
VLC_SUCCESS
;
}
src/playlist/engine.c
View file @
99a19a8f
...
...
@@ -233,13 +233,8 @@ static playlist_t *playlist_Create( vlc_object_t *p_parent )
pl_priv
(
p_playlist
)
->
b_auto_preparse
=
var_InheritBool
(
p_parent
,
"auto-preparse"
);
/* Fetcher */
p
->
p_fetcher
=
playlist_fetcher_New
(
VLC_OBJECT
(
p_playlist
)
);
if
(
unlikely
(
p
->
p_fetcher
==
NULL
)
)
msg_Err
(
p_playlist
,
"cannot create fetcher"
);
/* Preparser */
p
->
p_preparser
=
playlist_preparser_New
(
VLC_OBJECT
(
p_playlist
),
p
->
p_fetcher
);
/* Preparser (and meta retriever) */
p
->
p_preparser
=
playlist_preparser_New
(
VLC_OBJECT
(
p_playlist
)
);
if
(
unlikely
(
p
->
p_preparser
==
NULL
)
)
msg_Err
(
p_playlist
,
"cannot create preparser"
);
...
...
@@ -341,8 +336,6 @@ void playlist_Destroy( playlist_t *p_playlist )
playlist_Deactivate
(
p_playlist
);
if
(
p_sys
->
p_preparser
)
playlist_preparser_Delete
(
p_sys
->
p_preparser
);
if
(
p_sys
->
p_fetcher
)
playlist_fetcher_Delete
(
p_sys
->
p_fetcher
);
/* Release input resources */
assert
(
p_sys
->
p_input
==
NULL
);
...
...
src/playlist/playlist_internal.h
View file @
99a19a8f
...
...
@@ -38,7 +38,6 @@
#include <assert.h>
#include "art.h"
#include "fetcher.h"
#include "preparser.h"
typedef
struct
vlc_sd_internal_t
vlc_sd_internal_t
;
...
...
@@ -47,7 +46,6 @@ typedef struct playlist_private_t
{
playlist_t
public_data
;
playlist_preparser_t
*
p_preparser
;
/**< Preparser data */
playlist_fetcher_t
*
p_fetcher
;
/**< Meta and art fetcher data */
playlist_item_array_t
items_to_delete
;
/**< Array of items and nodes to
delete... At the very end. This sucks. */
...
...
src/playlist/preparser.c
View file @
99a19a8f
...
...
@@ -56,15 +56,17 @@ static void *Thread( void * );
/*****************************************************************************
* Public functions
*****************************************************************************/
playlist_preparser_t
*
playlist_preparser_New
(
vlc_object_t
*
parent
,
playlist_fetcher_t
*
p_fetcher
)
playlist_preparser_t
*
playlist_preparser_New
(
vlc_object_t
*
parent
)
{
playlist_preparser_t
*
p_preparser
=
malloc
(
sizeof
(
*
p_preparser
)
);
if
(
!
p_preparser
)
return
NULL
;
p_preparser
->
object
=
parent
;
p_preparser
->
p_fetcher
=
p_fetcher
;
p_preparser
->
p_fetcher
=
playlist_fetcher_New
(
parent
);
if
(
unlikely
(
p_preparser
->
p_fetcher
==
NULL
)
)
msg_Err
(
parent
,
"cannot create fetcher"
);
vlc_mutex_init
(
&
p_preparser
->
lock
);
vlc_cond_init
(
&
p_preparser
->
wait
);
p_preparser
->
b_live
=
false
;
...
...
@@ -93,6 +95,13 @@ void playlist_preparser_Push( playlist_preparser_t *p_preparser, input_item_t *p
vlc_mutex_unlock
(
&
p_preparser
->
lock
);
}
void
playlist_preparser_fetcher_Push
(
playlist_preparser_t
*
p_preparser
,
input_item_t
*
p_item
)
{
if
(
p_preparser
->
p_fetcher
!=
NULL
)
playlist_fetcher_Push
(
p_preparser
->
p_fetcher
,
p_item
);
}
void
playlist_preparser_Delete
(
playlist_preparser_t
*
p_preparser
)
{
vlc_mutex_lock
(
&
p_preparser
->
lock
);
...
...
@@ -110,6 +119,9 @@ void playlist_preparser_Delete( playlist_preparser_t *p_preparser )
/* Destroy the item preparser */
vlc_cond_destroy
(
&
p_preparser
->
wait
);
vlc_mutex_destroy
(
&
p_preparser
->
lock
);
if
(
p_preparser
->
p_fetcher
!=
NULL
)
playlist_fetcher_Delete
(
p_preparser
->
p_fetcher
);
free
(
p_preparser
);
}
...
...
src/playlist/preparser.h
View file @
99a19a8f
...
...
@@ -37,8 +37,7 @@ typedef struct playlist_preparser_t playlist_preparser_t;
/**
* This function creates the preparser object and thread.
*/
playlist_preparser_t
*
playlist_preparser_New
(
vlc_object_t
*
,
playlist_fetcher_t
*
);
playlist_preparser_t
*
playlist_preparser_New
(
vlc_object_t
*
);
/**
* This function enqueues the provided item to be preparsed.
...
...
@@ -48,6 +47,8 @@ playlist_preparser_t *playlist_preparser_New( vlc_object_t *,
*/
void
playlist_preparser_Push
(
playlist_preparser_t
*
,
input_item_t
*
);
void
playlist_preparser_fetcher_Push
(
playlist_preparser_t
*
,
input_item_t
*
);
/**
* This function destroys the preparser object and thread.
*
...
...
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