summaryrefslogtreecommitdiffstats
path: root/gst
diff options
context:
space:
mode:
authorZaheer Abbas Merali <zaheerabbas@merali.org>2008-10-06 12:01:14 +0000
committerZaheer Abbas Merali <zaheerabbas@merali.org>2008-10-06 12:01:14 +0000
commitc3e91e1a880e99201cecc8aae65256a39ce3ab4e (patch)
tree72ce7ddc78535f69fe74d3d89281129c009d6943 /gst
parent478417da1af5b168594167bc2ab4ab71b60085e9 (diff)
downloadgst-plugins-bad-c3e91e1a880e99201cecc8aae65256a39ce3ab4e.tar.gz
gst-plugins-bad-c3e91e1a880e99201cecc8aae65256a39ce3ab4e.tar.bz2
gst-plugins-bad-c3e91e1a880e99201cecc8aae65256a39ce3ab4e.zip
gst/mpegtsparse/mpegtsparse.c: Actually copy the structure passed in when assigning it because it gets freed straight...
Original commit message from CVS: * gst/mpegtsparse/mpegtsparse.c: Actually copy the structure passed in when assigning it because it gets freed straight after the function call. Re: pat_info and pmt_info GstStructures.
Diffstat (limited to 'gst')
-rw-r--r--gst/mpegtsparse/mpegtsparse.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/gst/mpegtsparse/mpegtsparse.c b/gst/mpegtsparse/mpegtsparse.c
index 3aa49db5..0886def2 100644
--- a/gst/mpegtsparse/mpegtsparse.c
+++ b/gst/mpegtsparse/mpegtsparse.c
@@ -851,7 +851,7 @@ mpegts_parse_apply_pat (MpegTSParse * parse, GstStructure * pat_info)
gchar *dbg;
old_pat = parse->pat;
- parse->pat = pat_info;
+ parse->pat = gst_structure_copy (pat_info);
dbg = gst_structure_to_string (pat_info);
GST_INFO_OBJECT (parse, "PAT %s", dbg);
@@ -975,14 +975,16 @@ mpegts_parse_apply_pmt (MpegTSParse * parse,
for (i = 0; i < gst_value_list_get_size (old_streams); ++i) {
value = gst_value_list_get_value (old_streams, i);
stream = g_value_get_boxed (value);
-
gst_structure_get_uint (stream, "pid", &pid);
gst_structure_get_uint (stream, "stream-type", &stream_type);
mpegts_parse_program_remove_stream (parse, program, (guint16) pid);
}
+
/* remove pcr stream */
mpegts_parse_program_remove_stream (parse, program, program->pcr_pid);
+
gst_structure_free (program->pmt_info);
+ program->pmt_info = NULL;
}
} else {
/* no PAT?? */
@@ -992,7 +994,7 @@ mpegts_parse_apply_pmt (MpegTSParse * parse,
}
/* activate new pmt */
- program->pmt_info = pmt_info;
+ program->pmt_info = gst_structure_copy (pmt_info);
program->pmt_pid = pmt_pid;
program->pcr_pid = pcr_pid;
mpegts_parse_program_add_stream (parse, program, (guint16) pcr_pid, -1);