summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLin YANG <oxcsnicho@gmail.com>2009-07-22 20:25:42 +0800
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2009-08-31 09:19:17 +0200
commit3ca8288c5b30bf90a46d091ae56c5dc26ae792ac (patch)
tree3bf71deeac7bedf3cc341c3db3e0468211126849
parent5b0b69a85812378bb7deedce0bb3c0e27e0316b5 (diff)
downloadgstreamer-plugins-bad-3ca8288c5b30bf90a46d091ae56c5dc26ae792ac.tar.gz
mpegtsmux: mux->programs: use GPrtArray instead of GArray
-rw-r--r--gst/mpegtsmux/mpegtsmux.c10
-rw-r--r--gst/mpegtsmux/mpegtsmux.h2
2 files changed, 5 insertions, 7 deletions
diff --git a/gst/mpegtsmux/mpegtsmux.c b/gst/mpegtsmux/mpegtsmux.c
index 07744a2bf..0fe27ff5c 100644
--- a/gst/mpegtsmux/mpegtsmux.c
+++ b/gst/mpegtsmux/mpegtsmux.c
@@ -211,10 +211,9 @@ mpegtsmux_init (MpegTsMux * mux, MpegTsMuxClass * g_class)
mux->tsmux = tsmux_new ();
tsmux_set_write_func (mux->tsmux, new_packet_cb, mux);
- mux->programs = g_array_sized_new (FALSE, TRUE, sizeof (TsMuxProgram *),
- MAX_PROG_NUMBER);
+ mux->programs = g_ptr_array_new ();
for (i = 0; i < MAX_PROG_NUMBER; i++)
- g_array_index (mux->programs, TsMuxProgram *, i) = NULL;
+ g_ptr_array_add (mux->programs, NULL);
mux->first = TRUE;
mux->last_flow_ret = GST_FLOW_OK;
@@ -249,7 +248,7 @@ mpegtsmux_dispose (GObject * object)
mux->prog_map = NULL;
}
if (mux->programs) {
- g_array_free (mux->programs, TRUE);
+ g_ptr_array_free (mux->programs, TRUE);
mux->programs = NULL;
}
@@ -488,8 +487,7 @@ mpegtsmux_create_streams (MpegTsMux * mux)
ts_data->prog = tsmux_program_new (mux->tsmux);
if (ts_data->prog == NULL)
goto no_program;
- g_array_index (mux->programs, TsMuxProgram *, ts_data->prog_id)
- = ts_data->prog;
+ g_ptr_array_index (mux->programs, ts_data->prog_id) = ts_data->prog;
}
if (ts_data->stream == NULL) {
diff --git a/gst/mpegtsmux/mpegtsmux.h b/gst/mpegtsmux/mpegtsmux.h
index 7e158553c..f4536fdf0 100644
--- a/gst/mpegtsmux/mpegtsmux.h
+++ b/gst/mpegtsmux/mpegtsmux.h
@@ -109,7 +109,7 @@ struct MpegTsMux {
GstCollectPads *collect;
TsMux *tsmux;
- GArray *programs;
+ GPtrArray *programs;
GstStructure *prog_map;
gboolean first;