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
7c6d1896
Commit
7c6d1896
authored
Apr 23, 2012
by
Jonathan Dieter
Committed by
Max Kellermann
Apr 23, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tag_rva2: support separate album/track replay gain
parent
ad83c7f7
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
2 deletions
+11
-2
NEWS
NEWS
+2
-0
tag_rva2.c
src/tag_rva2.c
+9
-2
No files found.
NEWS
View file @
7c6d1896
...
...
@@ -11,6 +11,8 @@ ver 0.17 (2011/??/??)
- curl: enable CURLOPT_NETRC
- curl: non-blocking I/O
- soup: new input plugin based on libsoup
* tags:
- RVA2: support separate album/track replay gain
* decoder:
- mpg123: implement seeking
- ffmpeg: drop support for pre-0.5 ffmpeg
...
...
src/tag_rva2.c
View file @
7c6d1896
...
...
@@ -22,6 +22,7 @@
#include "replay_gain_info.h"
#include <stdint.h>
#include <string.h>
#include <glib.h>
#include <id3tag.h>
...
...
@@ -73,15 +74,21 @@ rva2_float_volume_adjustment(const struct rva2_data *data)
static
inline
bool
rva2_apply_data
(
struct
replay_gain_info
*
replay_gain_info
,
const
struct
rva2_data
*
data
)
const
struct
rva2_data
*
data
,
const
id3_latin1_t
*
id
)
{
if
(
data
->
type
!=
CHANNEL_MASTER_VOLUME
)
return
false
;
float
volume_adjustment
=
rva2_float_volume_adjustment
(
data
);
if
(
strcmp
((
const
char
*
)
id
,
"album"
)
==
0
)
{
replay_gain_info
->
tuples
[
REPLAY_GAIN_ALBUM
].
gain
=
volume_adjustment
;
}
else
if
(
strcmp
((
const
char
*
)
id
,
"track"
)
==
0
)
{
replay_gain_info
->
tuples
[
REPLAY_GAIN_TRACK
].
gain
=
volume_adjustment
;
}
else
{
replay_gain_info
->
tuples
[
REPLAY_GAIN_ALBUM
].
gain
=
volume_adjustment
;
replay_gain_info
->
tuples
[
REPLAY_GAIN_TRACK
].
gain
=
volume_adjustment
;
}
return
true
;
}
...
...
@@ -115,7 +122,7 @@ rva2_apply_frame(struct replay_gain_info *replay_gain_info,
if
(
4
+
peak_bytes
>
length
)
break
;
if
(
rva2_apply_data
(
replay_gain_info
,
d
))
if
(
rva2_apply_data
(
replay_gain_info
,
d
,
id
))
return
true
;
data
+=
4
+
peak_bytes
;
...
...
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