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
8cce1762
Commit
8cce1762
authored
Oct 14, 2007
by
Rafaël Carré
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
audioscrobbler: read the metadata when it has been extracted.
parent
248d9c52
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
38 deletions
+14
-38
modules/misc/audioscrobbler.c
modules/misc/audioscrobbler.c
+14
-38
No files found.
modules/misc/audioscrobbler.c
View file @
8cce1762
...
@@ -96,8 +96,9 @@ struct intf_sys_t
...
@@ -96,8 +96,9 @@ struct intf_sys_t
vlc_bool_t
b_state_cb
;
/**< if we registered the
vlc_bool_t
b_state_cb
;
/**< if we registered the
* "state" callback */
* "state" callback */
vlc_bool_t
b_preparsed_cb
;
/**< if we registered the
* "meta-preparsed" callback*/
vlc_bool_t
b_meta_read
;
/**< if we read the song's
* metadata already */
};
};
static
int
Open
(
vlc_object_t
*
);
static
int
Open
(
vlc_object_t
*
);
...
@@ -109,8 +110,6 @@ static int ItemChange ( vlc_object_t *, const char *, vlc_value_t,
...
@@ -109,8 +110,6 @@ static int ItemChange ( vlc_object_t *, const char *, vlc_value_t,
vlc_value_t
,
void
*
);
vlc_value_t
,
void
*
);
static
int
PlayingChange
(
vlc_object_t
*
,
const
char
*
,
vlc_value_t
,
static
int
PlayingChange
(
vlc_object_t
*
,
const
char
*
,
vlc_value_t
,
vlc_value_t
,
void
*
);
vlc_value_t
,
void
*
);
static
int
MetaPreparsed
(
vlc_object_t
*
,
const
char
*
,
vlc_value_t
,
vlc_value_t
,
void
*
);
static
int
AddToQueue
(
intf_thread_t
*
);
static
int
AddToQueue
(
intf_thread_t
*
);
static
int
Handshake
(
intf_thread_t
*
);
static
int
Handshake
(
intf_thread_t
*
);
...
@@ -209,8 +208,6 @@ static void Close( vlc_object_t *p_this )
...
@@ -209,8 +208,6 @@ static void Close( vlc_object_t *p_this )
if
(
p_sys
->
b_state_cb
)
if
(
p_sys
->
b_state_cb
)
var_DelCallback
(
p_input
,
"state"
,
PlayingChange
,
p_intf
);
var_DelCallback
(
p_input
,
"state"
,
PlayingChange
,
p_intf
);
if
(
p_sys
->
b_preparsed_cb
)
var_DelCallback
(
p_input
,
"meta-preparsed"
,
MetaPreparsed
,
p_intf
);
vlc_object_release
(
p_input
);
vlc_object_release
(
p_input
);
}
}
...
@@ -462,6 +459,9 @@ static int PlayingChange( vlc_object_t *p_this, const char *psz_var,
...
@@ -462,6 +459,9 @@ static int PlayingChange( vlc_object_t *p_this, const char *psz_var,
if
(
p_intf
->
b_dead
)
if
(
p_intf
->
b_dead
)
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
if
(
p_sys
->
b_meta_read
==
VLC_FALSE
&&
newval
.
i_int
!=
INIT_S
)
ReadMetaData
(
p_intf
);
if
(
newval
.
i_int
==
END_S
||
newval
.
i_int
==
ERROR_S
)
if
(
newval
.
i_int
==
END_S
||
newval
.
i_int
==
ERROR_S
)
{
{
playlist_t
*
p_playlist
=
pl_Yield
(
p_intf
);
playlist_t
*
p_playlist
=
pl_Yield
(
p_intf
);
...
@@ -482,21 +482,6 @@ static int PlayingChange( vlc_object_t *p_this, const char *psz_var,
...
@@ -482,21 +482,6 @@ static int PlayingChange( vlc_object_t *p_this, const char *psz_var,
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
}
}
/*****************************************************************************
* MetaPreparsed: Meta data reading callback
*****************************************************************************/
static
int
MetaPreparsed
(
vlc_object_t
*
p_this
,
const
char
*
psz_var
,
vlc_value_t
oldval
,
vlc_value_t
newval
,
void
*
p_data
)
{
intf_thread_t
*
p_intf
=
(
intf_thread_t
*
)
p_data
;
if
(
p_intf
->
b_dead
)
return
VLC_SUCCESS
;
ReadMetaData
(
p_intf
);
return
VLC_SUCCESS
;
}
/*****************************************************************************
/*****************************************************************************
* ItemChange: Playlist item change callback
* ItemChange: Playlist item change callback
*****************************************************************************/
*****************************************************************************/
...
@@ -516,8 +501,8 @@ static int ItemChange( vlc_object_t *p_this, const char *psz_var,
...
@@ -516,8 +501,8 @@ static int ItemChange( vlc_object_t *p_this, const char *psz_var,
if
(
p_intf
->
b_dead
)
if
(
p_intf
->
b_dead
)
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
p_sys
->
b_preparsed_cb
=
VLC_FALSE
;
p_sys
->
b_state_cb
=
VLC_FALSE
;
p_sys
->
b_state_cb
=
VLC_FALSE
;
p_sys
->
b_meta_read
=
VLC_FALSE
;
/* We'll try to add the previously playing song in the queue */
/* We'll try to add the previously playing song in the queue */
if
(
AddToQueue
(
p_intf
)
==
VLC_ENOMEM
)
if
(
AddToQueue
(
p_intf
)
==
VLC_ENOMEM
)
...
@@ -564,23 +549,12 @@ static int ItemChange( vlc_object_t *p_this, const char *psz_var,
...
@@ -564,23 +549,12 @@ static int ItemChange( vlc_object_t *p_this, const char *psz_var,
p_sys
->
b_state_cb
=
VLC_TRUE
;
p_sys
->
b_state_cb
=
VLC_TRUE
;
if
(
input_item_IsPreparsed
(
p_item
)
)
if
(
input_item_IsPreparsed
(
p_item
)
)
{
ReadMetaData
(
p_intf
);
ReadMetaData
(
p_intf
);
vlc_object_release
(
p_input
);
/* if the input item was not preparsed, we'll do it in PlayingChange()
return
VLC_SUCCESS
;
* callback, when "state" != INIT_S */
}
else
vlc_object_release
(
p_input
);
{
return
VLC_SUCCESS
;
#if 0
/* XXX this won't work. One way would be to monitor p_input "state",
* once it is no more INIT_S, meta should be parsed */
/* We'll read the meta data when it will be preparsed */
var_AddCallback( p_input, "meta-preparsed", MetaPreparsed, p_intf );
p_sys->b_preparsed_cb = VLC_TRUE;
#endif
vlc_object_release
(
p_input
);
return
VLC_SUCCESS
;
}
}
}
/*****************************************************************************
/*****************************************************************************
...
@@ -995,6 +969,8 @@ static int ReadMetaData( intf_thread_t *p_this )
...
@@ -995,6 +969,8 @@ static int ReadMetaData( intf_thread_t *p_this )
vlc_mutex_lock
(
&
p_sys
->
lock
);
vlc_mutex_lock
(
&
p_sys
->
lock
);
p_sys
->
b_meta_read
=
VLC_TRUE
;
ALLOC_ITEM_META
(
p_sys
->
p_current_song
.
psz_a
,
Artist
)
ALLOC_ITEM_META
(
p_sys
->
p_current_song
.
psz_a
,
Artist
)
else
else
{
{
...
...
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