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
ba3a8474
Commit
ba3a8474
authored
Mar 01, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
flac: parse stream tags
Parse the vorbis comments in libflac's metadata_callback and pass them as tag struct to the decoder API.
parent
92db09fd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
2 deletions
+20
-2
NEWS
NEWS
+1
-0
_flac_common.c
src/decoder/_flac_common.c
+4
-0
flac_plugin.c
src/decoder/flac_plugin.c
+15
-2
No files found.
NEWS
View file @
ba3a8474
...
...
@@ -15,6 +15,7 @@ ver 0.15 - (200?/??/??)
- sidplay: new decoder plugin for C64 SID (using libsidplay2)
- fluidsynth: new decoder plugin for MIDI files (using libfluidsynth)
- wildmidi: another decoder plugin for MIDI files (using libwildmidi)
- flac: parse stream tags
- added configuration option to disable decoder plugins
* audio outputs:
- added option to disable audio outputs by default
...
...
src/decoder/_flac_common.c
View file @
ba3a8474
...
...
@@ -187,6 +187,10 @@ void flac_metadata_common_cb(const FLAC__StreamMetadata * block,
break
;
case
FLAC__METADATA_TYPE_VORBIS_COMMENT
:
flac_parse_replay_gain
(
block
,
data
);
if
(
data
->
tag
!=
NULL
)
flac_vorbis_comments_to_tag
(
data
->
tag
,
block
);
default:
break
;
}
...
...
src/decoder/flac_plugin.c
View file @
ba3a8474
...
...
@@ -292,6 +292,7 @@ flac_decode_internal(struct decoder * decoder,
{
flac_decoder
*
flac_dec
;
struct
flac_data
data
;
enum
decoder_command
cmd
;
const
char
*
err
=
NULL
;
if
(
!
(
flac_dec
=
flac_new
()))
...
...
@@ -326,6 +327,8 @@ flac_decode_internal(struct decoder * decoder,
}
}
data
.
tag
=
tag_new
();
if
(
!
flac_process_metadata
(
flac_dec
))
{
err
=
"problem reading metadata"
;
goto
fail
;
...
...
@@ -343,9 +346,17 @@ flac_decode_internal(struct decoder * decoder,
input_stream
->
seekable
,
data
.
total_time
);
while
(
true
)
{
if
(
!
tag_is_empty
(
data
.
tag
))
{
cmd
=
decoder_tag
(
decoder
,
input_stream
,
data
.
tag
);
tag_free
(
data
.
tag
);
data
.
tag
=
tag_new
();
}
else
cmd
=
decoder_get_command
(
decoder
);
if
(
!
flac_process_single
(
flac_dec
))
break
;
if
(
decoder_get_command
(
decoder
)
==
DECODE_COMMAND_SEEK
)
{
if
(
cmd
==
DECODE_COMMAND_SEEK
)
{
FLAC__uint64
seek_sample
=
decoder_seek_where
(
decoder
)
*
data
.
audio_format
.
sample_rate
+
0
.
5
;
if
(
flac_seek_absolute
(
flac_dec
,
seek_sample
))
{
...
...
@@ -358,7 +369,7 @@ flac_decode_internal(struct decoder * decoder,
}
else
if
(
flac_get_state
(
flac_dec
)
==
flac_decoder_eof
)
break
;
}
if
(
decoder_get_command
(
decoder
)
!=
DECODE_COMMAND_STOP
)
{
if
(
cmd
!=
DECODE_COMMAND_STOP
)
{
flacPrintErroredState
(
flac_get_state
(
flac_dec
));
flac_finish
(
flac_dec
);
}
...
...
@@ -367,6 +378,8 @@ fail:
if
(
data
.
replay_gain_info
)
replay_gain_info_free
(
data
.
replay_gain_info
);
tag_free
(
data
.
tag
);
if
(
flac_dec
)
flac_delete
(
flac_dec
);
...
...
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