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
333c0a6f
Commit
333c0a6f
authored
Jun 07, 2004
by
Warren Dukes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
some fixes to metadata stuff
git-svn-id:
https://svn.musicpd.org/mpd/trunk@1370
09075e82-0dd4-0310-85a5-a0d7c8717e4f
parent
ae44b7da
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
15 deletions
+16
-15
decode.c
src/decode.c
+0
-11
outputBuffer.c
src/outputBuffer.c
+11
-0
player.c
src/player.c
+5
-4
No files found.
src/decode.c
View file @
333c0a6f
...
...
@@ -388,17 +388,6 @@ int decoderInit(PlayerControl * pc, OutputBuffer * cb, DecoderControl * dc) {
return
0
;
}
#define copyMetadata() { \
memcpy(pc->metadata, metadata, DECODE_METADATA_LENGTH); \
pc->name = name; \
pc->title = title; \
pc->artist = artist; \
pc->album = album; \
gotMetadata = 0; \
pc->metadataState = PLAYER_METADATA_STATE_READ; \
kill(getppid(), SIGUSR1); \
}
void
handleMetadata
(
OutputBuffer
*
cb
,
PlayerControl
*
pc
,
int
*
previous
,
int
*
currentChunkSent
,
MetadataChunk
*
currentChunk
)
{
...
...
src/outputBuffer.c
View file @
333c0a6f
...
...
@@ -147,11 +147,19 @@ int sendDataToOutputBuffer(OutputBuffer * cb, InputStream * inStream,
int
copyMpdTagToOutputBuffer
(
OutputBuffer
*
cb
,
MpdTag
*
tag
)
{
int
nextChunk
;
static
MpdTag
*
last
=
NULL
;
printf
(
"copyMpdTagToOB called
\n
"
);
if
(
!
cb
->
acceptMetadata
||
!
tag
)
{
sendMetaChunk
=
0
;
if
(
last
)
free
(
last
);
last
=
NULL
;
return
0
;
}
if
(
last
&&
mpdTagsAreEqual
(
last
,
tag
))
{
printf
(
"same as last
\n
"
);
return
0
;
}
...
...
@@ -165,6 +173,9 @@ int copyMpdTagToOutputBuffer(OutputBuffer * cb, MpdTag * tag) {
printMpdTag
(
stdout
,
tag
);
if
(
last
)
freeMpdTag
(
last
);
last
=
mpdTagDup
(
tag
);
copyMpdTagToMetadataChunk
(
tag
,
&
(
cb
->
metadataChunks
[
currentMetaChunk
]));
cb
->
metaChunkSet
[
nextChunk
]
=
1
;
...
...
src/player.c
View file @
333c0a6f
...
...
@@ -470,6 +470,7 @@ void playerCycleLogFiles() {
Song
*
playerCurrentDecodeSong
()
{
static
Song
*
song
=
NULL
;
static
MetadataChunk
*
prev
=
NULL
;
Song
*
ret
=
NULL
;
PlayerControl
*
pc
=
&
(
getPlayerData
()
->
playerControl
);
if
(
pc
->
metadataState
==
PLAYER_METADATA_STATE_READ
&&
...
...
@@ -477,19 +478,19 @@ Song * playerCurrentDecodeSong() {
||
(
!
prev
||
memcmp
(
prev
,
&
(
pc
->
metadataChunk
),
sizeof
(
MetadataChunk
)))))
{
printf
(
"metadata in the PLAYER!
\n
"
);
if
(
prev
)
free
(
prev
);
prev
=
malloc
(
sizeof
(
MetadataChunk
));
memcpy
(
prev
,
&
(
pc
->
metadataChunk
),
sizeof
(
MetadataChunk
));
resetPlayerMetadata
();
if
(
song
)
freeJustSong
(
song
);
song
=
newNullSong
();
if
(
song
->
utf8url
)
free
(
song
->
utf8url
);
song
->
utf8url
=
strdup
(
pc
->
currentUrl
);
song
->
tag
=
metadataChunkToMpdTagDup
(
prev
);
validateUtf8Tag
(
song
->
tag
);
ret
urn
song
;
ret
=
song
;
}
return
NULL
;
resetPlayerMetadata
();
return
ret
;
}
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