mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 05:06:17 +00:00
mpegtsmux: mux->programs: use GPrtArray instead of GArray
This commit is contained in:
parent
5b0b69a858
commit
3ca8288c5b
2 changed files with 5 additions and 7 deletions
|
@ -211,10 +211,9 @@ mpegtsmux_init (MpegTsMux * mux, MpegTsMuxClass * g_class)
|
||||||
mux->tsmux = tsmux_new ();
|
mux->tsmux = tsmux_new ();
|
||||||
tsmux_set_write_func (mux->tsmux, new_packet_cb, mux);
|
tsmux_set_write_func (mux->tsmux, new_packet_cb, mux);
|
||||||
|
|
||||||
mux->programs = g_array_sized_new (FALSE, TRUE, sizeof (TsMuxProgram *),
|
mux->programs = g_ptr_array_new ();
|
||||||
MAX_PROG_NUMBER);
|
|
||||||
for (i = 0; i < MAX_PROG_NUMBER; i++)
|
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->first = TRUE;
|
||||||
mux->last_flow_ret = GST_FLOW_OK;
|
mux->last_flow_ret = GST_FLOW_OK;
|
||||||
|
@ -249,7 +248,7 @@ mpegtsmux_dispose (GObject * object)
|
||||||
mux->prog_map = NULL;
|
mux->prog_map = NULL;
|
||||||
}
|
}
|
||||||
if (mux->programs) {
|
if (mux->programs) {
|
||||||
g_array_free (mux->programs, TRUE);
|
g_ptr_array_free (mux->programs, TRUE);
|
||||||
mux->programs = NULL;
|
mux->programs = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -488,8 +487,7 @@ mpegtsmux_create_streams (MpegTsMux * mux)
|
||||||
ts_data->prog = tsmux_program_new (mux->tsmux);
|
ts_data->prog = tsmux_program_new (mux->tsmux);
|
||||||
if (ts_data->prog == NULL)
|
if (ts_data->prog == NULL)
|
||||||
goto no_program;
|
goto no_program;
|
||||||
g_array_index (mux->programs, TsMuxProgram *, ts_data->prog_id)
|
g_ptr_array_index (mux->programs, ts_data->prog_id) = ts_data->prog;
|
||||||
= ts_data->prog;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ts_data->stream == NULL) {
|
if (ts_data->stream == NULL) {
|
||||||
|
|
|
@ -109,7 +109,7 @@ struct MpegTsMux {
|
||||||
GstCollectPads *collect;
|
GstCollectPads *collect;
|
||||||
|
|
||||||
TsMux *tsmux;
|
TsMux *tsmux;
|
||||||
GArray *programs;
|
GPtrArray *programs;
|
||||||
GstStructure *prog_map;
|
GstStructure *prog_map;
|
||||||
|
|
||||||
gboolean first;
|
gboolean first;
|
||||||
|
|
Loading…
Reference in a new issue