tsdemux: fix refcounting when applying a new PMT

A new program object is created to replace an existing one
in the programs hash table, so its refcount needs to match.

With the default of 0 refcount on creation, the next PAT
change will cause that refcount to be both incremented and
decremented (assuming the new PAT references that stream too),
which will cause the program to be destroyed.

https://bugzilla.gnome.org/show_bug.cgi?id=748412
This commit is contained in:
Vincent Penquerc'h 2015-04-24 12:56:02 +01:00
parent d625770a18
commit 29fd6332a4

View file

@ -856,6 +856,7 @@ mpegts_base_apply_pmt (MpegTSBase * base, GstMpegtsSection * section)
if (old_program->active) {
old_program = mpegts_base_steal_program (base, program_number);
program = mpegts_base_new_program (base, program_number, section->pid);
program->patcount = old_program->patcount;
g_hash_table_insert (base->programs,
GINT_TO_POINTER (program_number), program);