mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-05 05:52:37 +00:00
tag: id3v2: avoid some relocations, make table static
This commit is contained in:
parent
f25c715104
commit
169c5033f0
1 changed files with 10 additions and 15 deletions
|
@ -265,16 +265,15 @@ id3v2_frame_hdr_size (guint id3v2ver)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static const gchar *obsolete_frame_ids[] = {
|
static const gchar obsolete_frame_ids[][5] = {
|
||||||
"CRM", "EQU", "LNK", "RVA", "TIM", "TSI", /* From 2.2 */
|
{"CRM"}, {"EQU"}, {"LNK"}, {"RVA"}, {"TIM"}, {"TSI"}, /* From 2.2 */
|
||||||
"EQUA", "RVAD", "TIME", "TRDA", "TSIZ", /* From 2.3 */
|
{"EQUA"}, {"RVAD"}, {"TIME"}, {"TRDA"}, {"TSIZ"} /* From 2.3 */
|
||||||
NULL
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const struct ID3v2FrameIDConvert
|
static const struct ID3v2FrameIDConvert
|
||||||
{
|
{
|
||||||
const gchar *orig;
|
const gchar orig[5];
|
||||||
const gchar *new;
|
const gchar new[5];
|
||||||
} frame_id_conversions[] = {
|
} frame_id_conversions[] = {
|
||||||
/* 2.3.x frames */
|
/* 2.3.x frames */
|
||||||
{
|
{
|
||||||
|
@ -338,28 +337,24 @@ const struct ID3v2FrameIDConvert
|
||||||
"WCM", "WCOM"}, {
|
"WCM", "WCOM"}, {
|
||||||
"WCP", "WCOP"}, {
|
"WCP", "WCOP"}, {
|
||||||
"WPB", "WPUB"}, {
|
"WPB", "WPUB"}, {
|
||||||
"WXX", "WXXX"}, {
|
"WXX", "WXXX"}
|
||||||
NULL, NULL}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
convert_fid_to_v240 (gchar * frame_id)
|
convert_fid_to_v240 (gchar * frame_id)
|
||||||
{
|
{
|
||||||
gint i = 0;
|
gint i;
|
||||||
|
|
||||||
while (obsolete_frame_ids[i] != NULL) {
|
for (i = 0; i < G_N_ELEMENTS (obsolete_frame_ids); ++i) {
|
||||||
if (strncmp (frame_id, obsolete_frame_ids[i], 5) == 0)
|
if (strncmp (frame_id, obsolete_frame_ids[i], 5) == 0)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
i++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
i = 0;
|
for (i = 0; i < G_N_ELEMENTS (frame_id_conversions); ++i) {
|
||||||
while (frame_id_conversions[i].orig != NULL) {
|
|
||||||
if (strncmp (frame_id, frame_id_conversions[i].orig, 5) == 0) {
|
if (strncmp (frame_id, frame_id_conversions[i].orig, 5) == 0) {
|
||||||
strcpy (frame_id, frame_id_conversions[i].new);
|
strcpy (frame_id, frame_id_conversions[i].new);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
i++;
|
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue