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
bfaf6cbd
Commit
bfaf6cbd
authored
Jun 09, 2004
by
Warren Dukes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix some streaming metadata issues
git-svn-id:
https://svn.musicpd.org/mpd/trunk@1416
09075e82-0dd4-0310-85a5-a0d7c8717e4f
parent
d5f7a774
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
9 deletions
+19
-9
decode.c
src/decode.c
+3
-1
ogg_plugin.c
src/inputPlugins/ogg_plugin.c
+3
-0
outputBuffer.c
src/outputBuffer.c
+10
-1
player.c
src/player.c
+3
-7
No files found.
src/decode.c
View file @
bfaf6cbd
...
...
@@ -393,7 +393,9 @@ void handleMetadata(OutputBuffer * cb, PlayerControl * pc, int * previous,
if
(
cb
->
begin
!=
cb
->
end
)
{
int
meta
=
cb
->
metaChunk
[
cb
->
begin
];
if
(
meta
!=
*
previous
)
{
DEBUG
(
"player: metadata change
\n
"
);
if
(
meta
>=
0
&&
cb
->
metaChunkSet
[
meta
])
{
DEBUG
(
"player: new metadata from decoder!
\n
"
);
memcpy
(
currentChunk
,
cb
->
metadataChunks
+
meta
,
sizeof
(
MetadataChunk
));
...
...
@@ -625,6 +627,7 @@ void decode() {
cb
=
&
(
getPlayerData
()
->
buffer
);
clearAllMetaChunkSets
(
cb
);
cb
->
begin
=
0
;
cb
->
end
=
0
;
pc
=
&
(
getPlayerData
()
->
playerControl
);
...
...
@@ -634,7 +637,6 @@ void decode() {
dc
->
seek
=
0
;
dc
->
stop
=
0
;
dc
->
start
=
1
;
clearAllMetaChunkSets
(
cb
);
if
(
decode_pid
==
NULL
||
*
decode_pid
<=
0
)
{
if
(
decoderInit
(
pc
,
cb
,
dc
)
<
0
)
return
;
...
...
src/inputPlugins/ogg_plugin.c
View file @
bfaf6cbd
...
...
@@ -206,6 +206,9 @@ void putOggCommentsIntoOutputBuffer(OutputBuffer * cb, char * streamName,
MpdTag
*
tag
;
tag
=
oggCommentsParse
(
comments
);
if
(
!
tag
&&
streamName
)
{
tag
=
newMpdTag
();
}
if
(
!
tag
)
return
;
/*if(tag->artist) printf("Artist: %s\n", tag->artist);
...
...
src/outputBuffer.c
View file @
bfaf6cbd
...
...
@@ -21,6 +21,7 @@
#include "pcm_utils.h"
#include "playerData.h"
#include "utils.h"
#include "log.h"
#include <string.h>
...
...
@@ -154,10 +155,12 @@ int copyMpdTagToOutputBuffer(OutputBuffer * cb, MpdTag * tag) {
sendMetaChunk
=
0
;
if
(
last
)
free
(
last
);
last
=
NULL
;
DEBUG
(
"copyMpdTagToOB: !acceptMetadata || !tag
\n
"
);
return
0
;
}
if
(
last
&&
mpdTagsAreEqual
(
last
,
tag
))
{
DEBUG
(
"copyMpdTagToOB: same as last
\n
"
);
return
0
;
}
...
...
@@ -167,7 +170,11 @@ int copyMpdTagToOutputBuffer(OutputBuffer * cb, MpdTag * tag) {
nextChunk
=
currentMetaChunk
+
1
;
if
(
nextChunk
>=
BUFFERED_METACHUNKS
)
nextChunk
=
0
;
if
(
cb
->
metaChunkSet
[
nextChunk
])
return
-
1
;
if
(
cb
->
metaChunkSet
[
nextChunk
])
{
sendMetaChunk
=
0
;
DEBUG
(
"copyMpdTagToOB: metachunk in use!
\n
"
);
return
-
1
;
}
sendMetaChunk
=
1
;
currentMetaChunk
=
nextChunk
;
...
...
@@ -178,5 +185,7 @@ int copyMpdTagToOutputBuffer(OutputBuffer * cb, MpdTag * tag) {
cb
->
metaChunkSet
[
nextChunk
]
=
1
;
DEBUG
(
"copyMpdTagToOB: copiedTag
\n
"
);
return
0
;
}
src/player.c
View file @
bfaf6cbd
...
...
@@ -473,11 +473,8 @@ Song * playerCurrentDecodeSong() {
Song
*
ret
=
NULL
;
PlayerControl
*
pc
=
&
(
getPlayerData
()
->
playerControl
);
if
(
pc
->
metadataState
==
PLAYER_METADATA_STATE_READ
&&
((
!
song
||
strcmp
(
song
->
utf8url
,
pc
->
currentUrl
))
||
(
!
prev
||
memcmp
(
prev
,
&
(
pc
->
metadataChunk
),
sizeof
(
MetadataChunk
)))))
{
if
(
pc
->
metadataState
==
PLAYER_METADATA_STATE_READ
)
{
DEBUG
(
"playerCurrentDecodeSong: caught new metadata!
\n
"
);
if
(
prev
)
free
(
prev
);
prev
=
malloc
(
sizeof
(
MetadataChunk
));
memcpy
(
prev
,
&
(
pc
->
metadataChunk
),
sizeof
(
MetadataChunk
));
...
...
@@ -488,9 +485,8 @@ Song * playerCurrentDecodeSong() {
song
->
tag
=
metadataChunkToMpdTagDup
(
prev
);
validateUtf8Tag
(
song
->
tag
);
ret
=
song
;
resetPlayerMetadata
();
}
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