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
dea5601e
Commit
dea5601e
authored
Jul 20, 2010
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tag_rva2: move code to rva2_apply_data()
parent
43a84055
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
11 deletions
+16
-11
tag_rva2.c
src/tag_rva2.c
+16
-11
No files found.
src/tag_rva2.c
View file @
dea5601e
...
@@ -71,6 +71,21 @@ rva2_float_volume_adjustment(const struct rva2_data *data)
...
@@ -71,6 +71,21 @@ rva2_float_volume_adjustment(const struct rva2_data *data)
return
(
float
)
rva2_fixed_volume_adjustment
(
data
)
/
(
float
)
512
;
return
(
float
)
rva2_fixed_volume_adjustment
(
data
)
/
(
float
)
512
;
}
}
static
inline
bool
rva2_apply_data
(
struct
replay_gain_info
*
replay_gain_info
,
const
struct
rva2_data
*
data
)
{
if
(
data
->
type
!=
CHANNEL_MASTER_VOLUME
)
return
false
;
float
volume_adjustment
=
rva2_float_volume_adjustment
(
data
);
replay_gain_info
->
tuples
[
REPLAY_GAIN_TRACK
].
gain
=
volume_adjustment
;
replay_gain_info
->
tuples
[
REPLAY_GAIN_ALBUM
].
gain
=
volume_adjustment
;
return
true
;
}
bool
bool
tag_rva2_parse
(
struct
id3_tag
*
tag
,
struct
replay_gain_info
*
replay_gain_info
)
tag_rva2_parse
(
struct
id3_tag
*
tag
,
struct
replay_gain_info
*
replay_gain_info
)
{
{
...
@@ -110,18 +125,8 @@ tag_rva2_parse(struct id3_tag *tag, struct replay_gain_info *replay_gain_info)
...
@@ -110,18 +125,8 @@ tag_rva2_parse(struct id3_tag *tag, struct replay_gain_info *replay_gain_info)
if
(
4
+
peak_bytes
>
length
)
if
(
4
+
peak_bytes
>
length
)
break
;
break
;
if
(
d
->
type
==
CHANNEL_MASTER_VOLUME
)
{
if
(
rva2_apply_data
(
replay_gain_info
,
d
))
double
voladj_float
=
rva2_float_volume_adjustment
(
d
);
replay_gain_info
->
tuples
[
REPLAY_GAIN_TRACK
].
gain
=
voladj_float
;
replay_gain_info
->
tuples
[
REPLAY_GAIN_ALBUM
].
gain
=
voladj_float
;
g_debug
(
"parseRVA2: Relative Volume "
"%+.1f dB adjustment (%s)
\n
"
,
voladj_float
,
id
);
return
true
;
return
true
;
}
data
+=
4
+
peak_bytes
;
data
+=
4
+
peak_bytes
;
length
-=
4
+
peak_bytes
;
length
-=
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