summaryrefslogtreecommitdiff
path: root/gst/id3tag
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim.muller@collabora.co.uk>2010-08-04 23:50:53 +0100
committerTim-Philipp Müller <tim.muller@collabora.co.uk>2010-08-04 23:56:04 +0100
commit770194a8fcc638924b29e78e9f24c4c7e7ef4b83 (patch)
tree1509c9c4837ebf64d0817b776b98ba1dae72281d /gst/id3tag
parent24ab5a470885b45724966a3715cd16fc16c78a15 (diff)
downloadgstreamer-plugins-bad-770194a8fcc638924b29e78e9f24c4c7e7ef4b83.tar.gz
id3mux: minor code clean-up
Add helper function to write text frames with just one string.
Diffstat (limited to 'gst/id3tag')
-rw-r--r--gst/id3tag/id3tag.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/gst/id3tag/id3tag.c b/gst/id3tag/id3tag.c
index 48f3a0818..a46c1a06b 100644
--- a/gst/id3tag/id3tag.c
+++ b/gst/id3tag/id3tag.c
@@ -157,6 +157,8 @@ static guint id3v2_frame_get_size (GstId3v2Tag * tag, GstId3v2Frame * frame);
static void id3v2_tag_add_text_frame (GstId3v2Tag * tag,
const gchar * frame_id, const gchar ** strings, int num_strings);
+static void id3v2_tag_add_simple_text_frame (GstId3v2Tag * tag,
+ const gchar * frame_id, const gchar * string);
static gboolean
id3v2_tag_init (GstId3v2Tag * tag, guint major_version)
@@ -434,6 +436,13 @@ id3v2_tag_add_text_frame (GstId3v2Tag * tag, const gchar * frame_id,
g_array_append_val (tag->frames, frame);
}
+static void
+id3v2_tag_add_simple_text_frame (GstId3v2Tag * tag, const gchar * frame_id,
+ const gchar * string)
+{
+ id3v2_tag_add_text_frame (tag, frame_id, (const gchar **) &string, 1);
+}
+
/* ====================================================================== */
static void
@@ -567,8 +576,7 @@ add_count_or_num_tag (GstId3v2Tag * id3v2tag, const GstTagList * list,
GST_DEBUG ("Setting %s to %s (frame_id = %s)", tag, tag_str, frame_id);
- id3v2_tag_add_text_frame (id3v2tag, frame_id, (const gchar **) &tag_str,
- 1);
+ id3v2_tag_add_simple_text_frame (id3v2tag, frame_id, tag_str);
g_free (tag_str);
}
} else if (corr[idx].corr_count == NULL) {
@@ -581,8 +589,7 @@ add_count_or_num_tag (GstId3v2Tag * id3v2tag, const GstTagList * list,
gchar *tag_str = g_strdup_printf ("0/%u", count);
GST_DEBUG ("Setting %s to %s (frame_id = %s)", tag, tag_str, frame_id);
- id3v2_tag_add_text_frame (id3v2tag, frame_id, (const gchar **) &tag_str,
- 1);
+ id3v2_tag_add_simple_text_frame (id3v2tag, frame_id, tag_str);
g_free (tag_str);
}
}
@@ -608,7 +615,7 @@ add_bpm_tag (GstId3v2Tag * id3v2tag, const GstTagList * list,
*/
tag_str = g_strdup_printf ("%u", (guint) bpm);
GST_DEBUG ("Setting %s to %s", tag, tag_str);
- id3v2_tag_add_text_frame (id3v2tag, "TBPM", (const gchar **) &tag_str, 1);
+ id3v2_tag_add_simple_text_frame (id3v2tag, "TBPM", tag_str);
g_free (tag_str);
}