summaryrefslogtreecommitdiff
path: root/gst/mpegtsdemux
diff options
context:
space:
mode:
authorVincent Penquerc'h <vincent.penquerch@collabora.co.uk>2015-04-24 12:56:02 +0100
committerVincent Penquerc'h <vincent.penquerch@collabora.co.uk>2015-05-15 14:45:49 +0100
commit29fd6332a463301532b215156f1cfbdd079bb461 (patch)
tree496c1f2d94d8efeded15b960b701c53129135679 /gst/mpegtsdemux
parentd625770a18f68b1a1eee2a71810cb2fe692ecee9 (diff)
downloadgstreamer-plugins-bad-29fd6332a463301532b215156f1cfbdd079bb461.tar.gz
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
Diffstat (limited to 'gst/mpegtsdemux')
-rw-r--r--gst/mpegtsdemux/mpegtsbase.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/gst/mpegtsdemux/mpegtsbase.c b/gst/mpegtsdemux/mpegtsbase.c
index 63e567cb2..e6acb3bb0 100644
--- a/gst/mpegtsdemux/mpegtsbase.c
+++ b/gst/mpegtsdemux/mpegtsbase.c
@@ -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);