+2008-04-03 Sebastian Dröge <slomo@circular-chaos.org>
+
+ * gst/mpegaudioparse/gstmpegaudioparse.c:
+ (mpeg_audio_seek_entry_new), (mpeg_audio_seek_entry_free),
+ (gst_mp3parse_reset), (gst_mp3parse_emit_frame):
+ * gst/mpegaudioparse/gstxingmux.c: (gst_xing_seek_entry_new),
+ (gst_xing_seek_entry_free), (gst_xing_mux_finalize), (xing_reset),
+ (gst_xing_mux_chain):
+ Use GSlice for allocating the seek table entries if we compile with
+ GLib 2.10 or newer.
+
2008-04-01 Wim Taymans <wim.taymans@collabora.co.uk>
* gst/asfdemux/gstasfdemux.c:
-Subproject commit 5421815aeed8b2d73a4d4d4a4b8eb2c93f1b7d02
+Subproject commit fda6da5f2b9b000f7e1df8ffb44a6185ffd9799b
#define GST_READ_UINT24_BE(p) (p[2] | (p[1] << 8) | (p[0] << 16))
+/* FIXME: unconditionally use GSlice after we depend on GLib >= 2.10 */
+#if GLIB_CHECK_VERSION (2, 10, 0)
+static inline MPEGAudioSeekEntry *
+mpeg_audio_seek_entry_new ()
+{
+ return g_slice_new (MPEGAudioSeekEntry);
+}
+
+static inline void
+mpeg_audio_seek_entry_free (MPEGAudioSeekEntry * entry)
+{
+ g_slice_free (MPEGAudioSeekEntry, entry);
+}
+#else
+static inline MPEGAudioSeekEntry *
+mpeg_audio_seek_entry_new ()
+{
+ return g_new (MPEGAudioSeekEntry, 1);
+}
+
+static inline void
+mpeg_audio_seek_entry_free (MPEGAudioSeekEntry * entry)
+{
+ g_free (entry);
+}
+#endif
+
/* elementfactory information */
static GstElementDetails mp3parse_details = {
"MPEG1 Audio Parser",
mp3parse->vbri_seek_table = NULL;
if (mp3parse->seek_table) {
- g_list_foreach (mp3parse->seek_table, (GFunc) g_free, NULL);
+ g_list_foreach (mp3parse->seek_table, (GFunc) mpeg_audio_seek_entry_free,
+ NULL);
g_list_free (mp3parse->seek_table);
mp3parse->seek_table = NULL;
}
(!mp3parse->seek_table ||
(mp3parse_seek_table_last_entry (mp3parse))->byte <
GST_BUFFER_OFFSET (outbuf))) {
- MPEGAudioSeekEntry *entry = g_new0 (MPEGAudioSeekEntry, 1);
+ MPEGAudioSeekEntry *entry = mpeg_audio_seek_entry_new ();
entry->byte = mp3parse->cur_offset;
entry->timestamp = GST_BUFFER_TIMESTAMP (outbuf);
gint byte;
} GstXingSeekEntry;
+/* FIXME: unconditionally use GSlice after we depend on GLib >= 2.10 */
+#if GLIB_CHECK_VERSION (2, 10, 0)
+static inline GstXingSeekEntry *
+gst_xing_seek_entry_new ()
+{
+ return g_slice_new (GstXingSeekEntry);
+}
+
+static inline void
+gst_xing_seek_entry_free (GstXingSeekEntry * entry)
+{
+ g_slice_free (GstXingSeekEntry, entry);
+}
+#else
+static inline GstXingSeekEntry *
+gst_xing_seek_entry_new ()
+{
+ return g_new (GstXingSeekEntry, 1);
+}
+
+static inline void
+gst_xing_seek_entry_free (GstXingSeekEntry * entry)
+{
+ g_free (entry);
+}
+#endif
+
static void gst_xing_mux_finalize (GObject * obj);
static GstStateChangeReturn
gst_xing_mux_change_state (GstElement * element, GstStateChange transition);
}
if (xing->seek_table) {
- g_list_foreach (xing->seek_table, (GFunc) g_free, NULL);
+ g_list_foreach (xing->seek_table, (GFunc) gst_xing_seek_entry_free, NULL);
g_list_free (xing->seek_table);
xing->seek_table = NULL;
}
gst_adapter_clear (xing->adapter);
if (xing->seek_table) {
- g_list_foreach (xing->seek_table, (GFunc) g_free, NULL);
+ g_list_foreach (xing->seek_table, (GFunc) gst_xing_seek_entry_free, NULL);
g_list_free (xing->seek_table);
xing->seek_table = NULL;
}
}
}
- seek_entry = g_new (GstXingSeekEntry, 1);
+ seek_entry = gst_xing_seek_entry_new ();
seek_entry->timestamp =
(xing->duration == GST_CLOCK_TIME_NONE) ? 0 : xing->duration;
/* Workaround for parsers checking that the first seek table entry is 0 */