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
172182b1
Commit
172182b1
authored
Jul 20, 2010
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder/mad: parse_rva2() returns bool
parent
898a13f1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
9 deletions
+8
-9
mad_plugin.c
src/decoder/mad_plugin.c
+8
-9
No files found.
src/decoder/mad_plugin.c
View file @
172182b1
...
@@ -209,14 +209,14 @@ mp3_fill_buffer(struct mp3_data *data)
...
@@ -209,14 +209,14 @@ mp3_fill_buffer(struct mp3_data *data)
#ifdef HAVE_ID3TAG
#ifdef HAVE_ID3TAG
/* Parse mp3 RVA2 frame. Shamelessly stolen from madplay. */
/* Parse mp3 RVA2 frame. Shamelessly stolen from madplay. */
static
int
parse_rva2
(
struct
id3_tag
*
tag
,
struct
replay_gain_info
*
replay_gain_info
)
static
bool
parse_rva2
(
struct
id3_tag
*
tag
,
struct
replay_gain_info
*
replay_gain_info
)
{
{
struct
id3_frame
const
*
frame
;
struct
id3_frame
const
*
frame
;
id3_latin1_t
const
*
id
;
id3_latin1_t
const
*
id
;
id3_byte_t
const
*
data
;
id3_byte_t
const
*
data
;
id3_length_t
length
;
id3_length_t
length
;
int
found
;
enum
{
enum
{
CHANNEL_OTHER
=
0x00
,
CHANNEL_OTHER
=
0x00
,
...
@@ -230,18 +230,18 @@ static int parse_rva2(struct id3_tag * tag, struct replay_gain_info * replay_gai
...
@@ -230,18 +230,18 @@ static int parse_rva2(struct id3_tag * tag, struct replay_gain_info * replay_gai
CHANNEL_SUBWOOFER
=
0x08
CHANNEL_SUBWOOFER
=
0x08
};
};
found
=
0
;
/* relative volume adjustment information */
/* relative volume adjustment information */
frame
=
id3_tag_findframe
(
tag
,
"RVA2"
,
0
);
frame
=
id3_tag_findframe
(
tag
,
"RVA2"
,
0
);
if
(
!
frame
)
return
0
;
if
(
frame
==
NULL
)
return
false
;
id
=
id3_field_getlatin1
(
id3_frame_field
(
frame
,
0
));
id
=
id3_field_getlatin1
(
id3_frame_field
(
frame
,
0
));
data
=
id3_field_getbinarydata
(
id3_frame_field
(
frame
,
1
),
data
=
id3_field_getbinarydata
(
id3_frame_field
(
frame
,
1
),
&
length
);
&
length
);
if
(
!
id
||
!
data
)
return
0
;
if
(
id
==
NULL
||
data
==
NULL
)
return
false
;
/*
/*
* "The 'identification' string is used to identify the
* "The 'identification' string is used to identify the
...
@@ -284,15 +284,14 @@ static int parse_rva2(struct id3_tag * tag, struct replay_gain_info * replay_gai
...
@@ -284,15 +284,14 @@ static int parse_rva2(struct id3_tag * tag, struct replay_gain_info * replay_gai
"%+.1f dB adjustment (%s)
\n
"
,
"%+.1f dB adjustment (%s)
\n
"
,
voladj_float
,
id
);
voladj_float
,
id
);
found
=
1
;
return
true
;
break
;
}
}
data
+=
4
+
peak_bytes
;
data
+=
4
+
peak_bytes
;
length
-=
4
+
peak_bytes
;
length
-=
4
+
peak_bytes
;
}
}
return
f
ound
;
return
f
alse
;
}
}
#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