tag_rva2: move code to rva2_apply_frame()
This commit is contained in:
parent
6b52d040b1
commit
ad83c7f704
@ -86,24 +86,14 @@ rva2_apply_data(struct replay_gain_info *replay_gain_info,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
static bool
|
||||||
tag_rva2_parse(struct id3_tag *tag, struct replay_gain_info *replay_gain_info)
|
rva2_apply_frame(struct replay_gain_info *replay_gain_info,
|
||||||
|
const struct id3_frame *frame)
|
||||||
{
|
{
|
||||||
struct id3_frame const * frame;
|
const id3_latin1_t *id = id3_field_getlatin1(id3_frame_field(frame, 0));
|
||||||
|
|
||||||
id3_latin1_t const *id;
|
|
||||||
id3_byte_t const *data;
|
|
||||||
id3_length_t length;
|
id3_length_t length;
|
||||||
|
const id3_byte_t *data =
|
||||||
/* relative volume adjustment information */
|
id3_field_getbinarydata(id3_frame_field(frame, 1), &length);
|
||||||
|
|
||||||
frame = id3_tag_findframe(tag, "RVA2", 0);
|
|
||||||
if (frame == NULL)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
id = id3_field_getlatin1(id3_frame_field(frame, 0));
|
|
||||||
data = id3_field_getbinarydata(id3_frame_field(frame, 1),
|
|
||||||
&length);
|
|
||||||
|
|
||||||
if (id == NULL || data == NULL)
|
if (id == NULL || data == NULL)
|
||||||
return false;
|
return false;
|
||||||
@ -134,3 +124,10 @@ tag_rva2_parse(struct id3_tag *tag, struct replay_gain_info *replay_gain_info)
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
tag_rva2_parse(struct id3_tag *tag, struct replay_gain_info *replay_gain_info)
|
||||||
|
{
|
||||||
|
struct id3_frame const *frame = id3_tag_findframe(tag, "RVA2", 0);
|
||||||
|
return frame != NULL && rva2_apply_frame(replay_gain_info, frame);
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user