diff options
author | Jan Schmidt <jan@centricular.com> | 2016-04-12 04:16:55 +1000 |
---|---|---|
committer | Jan Schmidt <jan@centricular.com> | 2016-04-12 14:09:47 +1000 |
commit | d6ea4d83f289580d0ad1508bf1145d4511daf99f (patch) | |
tree | a7f1a81071d49abd86e329c5057b3e646c5bee11 /gst/mpegtsdemux | |
parent | 5115eadc467fa717a713efcd1bb678218ff88bb6 (diff) | |
download | gstreamer-plugins-bad-d6ea4d83f289580d0ad1508bf1145d4511daf99f.tar.gz |
mpegtsbase: Fix when applying new PMT with same program number
When the sub-class is delaying deactivation of the old program,
but it has the same program number as the new program, don't
overwrite the old program in the hash table and then steal
the new program back out of it. Instead, add the new program to
the hash table after handling removal of the old one.
Diffstat (limited to 'gst/mpegtsdemux')
-rw-r--r-- | gst/mpegtsdemux/mpegtsbase.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gst/mpegtsdemux/mpegtsbase.c b/gst/mpegtsdemux/mpegtsbase.c index 293a32ca2..481695adc 100644 --- a/gst/mpegtsdemux/mpegtsbase.c +++ b/gst/mpegtsdemux/mpegtsbase.c @@ -886,8 +886,6 @@ mpegts_base_apply_pmt (MpegTSBase * base, GstMpegtsSection * section) 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); /* Desactivate the old program */ /* FIXME : THIS IS BREAKING THE STREAM SWITCHING LOGIC ! @@ -901,6 +899,9 @@ mpegts_base_apply_pmt (MpegTSBase * base, GstMpegtsSection * section) g_hash_table_steal (base->programs, GINT_TO_POINTER ((gint) old_program->program_number)); } + /* Add new program to the programs we track */ + g_hash_table_insert (base->programs, + GINT_TO_POINTER (program_number), program); initial_program = FALSE; } else program = old_program; |