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
020c04e7
Commit
020c04e7
authored
Nov 02, 2008
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder_api: added decoder_tag()
Provide an API for submitting additional tags from the stream.
parent
5b13f067
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
2 deletions
+30
-2
oggvorbis_plugin.c
src/decoder/oggvorbis_plugin.c
+6
-2
decoder_api.c
src/decoder_api.c
+13
-0
decoder_api.h
src/decoder_api.h
+11
-0
No files found.
src/decoder/oggvorbis_plugin.c
View file @
020c04e7
...
@@ -179,7 +179,9 @@ static struct tag *oggCommentsParse(char **comments)
...
@@ -179,7 +179,9 @@ static struct tag *oggCommentsParse(char **comments)
return
tag
;
return
tag
;
}
}
static
void
putOggCommentsIntoOutputBuffer
(
char
*
streamName
,
static
void
putOggCommentsIntoOutputBuffer
(
struct
decoder
*
decoder
,
struct
input_stream
*
is
,
char
*
streamName
,
char
**
comments
)
char
**
comments
)
{
{
struct
tag
*
tag
;
struct
tag
*
tag
;
...
@@ -196,6 +198,7 @@ static void putOggCommentsIntoOutputBuffer(char *streamName,
...
@@ -196,6 +198,7 @@ static void putOggCommentsIntoOutputBuffer(char *streamName,
tag_add_item
(
tag
,
TAG_ITEM_NAME
,
streamName
);
tag_add_item
(
tag
,
TAG_ITEM_NAME
,
streamName
);
}
}
decoder_tag
(
decoder
,
is
,
tag
);
tag_free
(
tag
);
tag_free
(
tag
);
}
}
...
@@ -284,7 +287,8 @@ oggvorbis_decode(struct decoder *decoder, struct input_stream *inStream)
...
@@ -284,7 +287,8 @@ oggvorbis_decode(struct decoder *decoder, struct input_stream *inStream)
initialized
=
true
;
initialized
=
true
;
}
}
comments
=
ov_comment
(
&
vf
,
-
1
)
->
user_comments
;
comments
=
ov_comment
(
&
vf
,
-
1
)
->
user_comments
;
putOggCommentsIntoOutputBuffer
(
inStream
->
meta_name
,
putOggCommentsIntoOutputBuffer
(
decoder
,
inStream
,
inStream
->
meta_name
,
comments
);
comments
);
ogg_getReplayGainInfo
(
comments
,
&
replayGainInfo
);
ogg_getReplayGainInfo
(
comments
,
&
replayGainInfo
);
}
}
...
...
src/decoder_api.c
View file @
020c04e7
...
@@ -190,3 +190,16 @@ decoder_data(struct decoder *decoder,
...
@@ -190,3 +190,16 @@ decoder_data(struct decoder *decoder,
return
DECODE_COMMAND_NONE
;
return
DECODE_COMMAND_NONE
;
}
}
enum
decoder_command
decoder_tag
(
mpd_unused
struct
decoder
*
decoder
,
struct
input_stream
*
is
,
const
struct
tag
*
tag
)
{
while
(
!
music_pipe_tag
(
tag
))
{
enum
decoder_command
cmd
=
need_chunks
(
is
);
if
(
cmd
!=
DECODE_COMMAND_NONE
)
return
cmd
;
}
return
DECODE_COMMAND_NONE
;
}
src/decoder_api.h
View file @
020c04e7
...
@@ -155,4 +155,15 @@ decoder_data(struct decoder *decoder,
...
@@ -155,4 +155,15 @@ decoder_data(struct decoder *decoder,
void
*
data
,
size_t
datalen
,
float
data_time
,
uint16_t
bitRate
,
void
*
data
,
size_t
datalen
,
float
data_time
,
uint16_t
bitRate
,
ReplayGainInfo
*
replayGainInfo
);
ReplayGainInfo
*
replayGainInfo
);
/**
* This function is called by the decoder plugin when it has
* successfully decoded a tag.
*
* @param is an input stream which is buffering while we are waiting
* for the player
*/
enum
decoder_command
decoder_tag
(
struct
decoder
*
decoder
,
struct
input_stream
*
is
,
const
struct
tag
*
tag
);
#endif
#endif
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