Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
0749dbfa
Commit
0749dbfa
authored
Jul 23, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
player_thread: moved code to update_song_tag()
parent
54889c72
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
19 deletions
+27
-19
player_thread.c
src/player_thread.c
+27
-19
No files found.
src/player_thread.c
View file @
0749dbfa
...
...
@@ -414,6 +414,31 @@ static void player_process_command(struct player *player)
}
}
static
void
update_song_tag
(
struct
song
*
song
,
const
struct
tag
*
new_tag
)
{
struct
tag
*
old_tag
;
if
(
song_is_file
(
song
))
/* don't update tags of local files, only remote
streams may change tags dynamically */
return
;
old_tag
=
song
->
tag
;
song
->
tag
=
tag_dup
(
new_tag
);
if
(
old_tag
!=
NULL
)
tag_free
(
old_tag
);
/* the main thread will update the playlist version when he
receives this event */
event_pipe_emit
(
PIPE_EVENT_TAG
);
/* notify all clients that the tag of the current song has
changed */
idle_add
(
IDLE_PLAYER
);
}
/**
* Plays a #music_chunk object (after applying software volume). If
* it contains a (stream) tag, copy it to the current song, so MPD's
...
...
@@ -425,25 +450,8 @@ play_chunk(struct song *song, struct music_chunk *chunk,
{
assert
(
music_chunk_check_format
(
chunk
,
format
));
if
(
chunk
->
tag
!=
NULL
)
{
if
(
!
song_is_file
(
song
))
{
/* always update the tag of remote streams */
struct
tag
*
old_tag
=
song
->
tag
;
song
->
tag
=
tag_dup
(
chunk
->
tag
);
if
(
old_tag
!=
NULL
)
tag_free
(
old_tag
);
/* the main thread will update the playlist
version when he receives this event */
event_pipe_emit
(
PIPE_EVENT_TAG
);
/* notify all clients that the tag of the
current song has changed */
idle_add
(
IDLE_PLAYER
);
}
}
if
(
chunk
->
tag
!=
NULL
)
update_song_tag
(
song
,
chunk
->
tag
);
if
(
chunk
->
length
==
0
)
{
music_buffer_return
(
player_buffer
,
chunk
);
...
...
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