mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 18:21:04 +00:00
mpegts: Don't leave freed programs in the hash table
When the sub-class claims a program for later freeing, make sure it's not left in the hash table, or it can cause crashes on shutdown. Make sure tsdemux frees any program it has kept around at shutdown if it wasn't freed already. https://bugzilla.gnome.org/show_bug.cgi?id=763503
This commit is contained in:
parent
92f4eb45ab
commit
6de7f0c0fa
2 changed files with 15 additions and 0 deletions
|
@ -816,6 +816,11 @@ mpegts_base_apply_pat (MpegTSBase * base, GstMpegtsSection * section)
|
|||
if (klass->can_remove_program (base, program)) {
|
||||
mpegts_base_deactivate_program (base, program);
|
||||
mpegts_base_remove_program (base, patp->program_number);
|
||||
} else {
|
||||
/* sub-class now owns the program and must call
|
||||
* mpegts_base_deactivate_and_free_program later */
|
||||
g_hash_table_steal (base->programs,
|
||||
GINT_TO_POINTER ((gint) patp->program_number));
|
||||
}
|
||||
/* FIXME: when this happens it may still be pmt pid of another
|
||||
* program, so setting to False may make it go through expensive
|
||||
|
@ -891,6 +896,11 @@ mpegts_base_apply_pmt (MpegTSBase * base, GstMpegtsSection * section)
|
|||
if (klass->can_remove_program (base, old_program)) {
|
||||
mpegts_base_deactivate_program (base, old_program);
|
||||
mpegts_base_free_program (old_program);
|
||||
} else {
|
||||
/* sub-class now owns the program and must call
|
||||
* mpegts_base_deactivate_and_free_program later */
|
||||
g_hash_table_steal (base->programs,
|
||||
GINT_TO_POINTER ((gint) old_program->program_number));
|
||||
}
|
||||
initial_program = FALSE;
|
||||
} else
|
||||
|
|
|
@ -407,6 +407,11 @@ gst_ts_demux_reset (MpegTSBase * base)
|
|||
demux->global_tags = NULL;
|
||||
}
|
||||
|
||||
if (demux->previous_program) {
|
||||
mpegts_base_deactivate_and_free_program (base, demux->previous_program);
|
||||
demux->previous_program = NULL;
|
||||
}
|
||||
|
||||
demux->have_group_id = FALSE;
|
||||
demux->group_id = G_MAXUINT;
|
||||
|
||||
|
|
Loading…
Reference in a new issue