summaryrefslogtreecommitdiffstats
path: root/gst/mpegtsparse
diff options
context:
space:
mode:
authorWai-Ming Ho <webregbox@yahoo.co.uk>2007-11-15 19:03:33 +0000
committerWim Taymans <wim.taymans@gmail.com>2007-11-15 19:03:33 +0000
commit5d794c0007a6bbd8d1c0589e3f7d8836018550e5 (patch)
tree687dc395547051404dbf8e10bb8ce1118f816149 /gst/mpegtsparse
parent0830d14b2784cfb8b5a54adf67d7df59164687cf (diff)
downloadgst-plugins-bad-5d794c0007a6bbd8d1c0589e3f7d8836018550e5.tar.gz
gst-plugins-bad-5d794c0007a6bbd8d1c0589e3f7d8836018550e5.tar.bz2
gst-plugins-bad-5d794c0007a6bbd8d1c0589e3f7d8836018550e5.zip
gst/mpegtsparse/mpegtspacketizer.c: Ensure that the plugin does not crash when the property pat-info is queried befor...
Original commit message from CVS: Patch by: Wai-Ming Ho <webregbox at yahoo dot co dot uk> * gst/mpegtsparse/mpegtspacketizer.c: (foreach_stream_clear), (remove_all), (mpegts_packetizer_clear): Ensure that the plugin does not crash when the property pat-info is queried before a PAT is available. It also ensures that the PAT info is cleared when the changing from PLAYING to READY. Fixes #487892.
Diffstat (limited to 'gst/mpegtsparse')
-rw-r--r--gst/mpegtsparse/mpegtspacketizer.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/gst/mpegtsparse/mpegtspacketizer.c b/gst/mpegtsparse/mpegtspacketizer.c
index 86d94b39..1aac7991 100644
--- a/gst/mpegtsparse/mpegtspacketizer.c
+++ b/gst/mpegtsparse/mpegtspacketizer.c
@@ -428,20 +428,29 @@ error:
static void
foreach_stream_clear (gpointer key, gpointer value, gpointer data)
{
- MpegTSPacketizer *packetizer = (MpegTSPacketizer *) data;
MpegTSPacketizerStream *stream = (MpegTSPacketizerStream *) value;
- mpegts_packetizer_clear_section (packetizer, stream);
+ /* remove the stream */
+ g_object_unref (stream->section_adapter);
+ g_free (stream);
+}
+
+static gboolean
+remove_all (gpointer key, gpointer value, gpointer user_data)
+{
+ return TRUE;
}
void
mpegts_packetizer_clear (MpegTSPacketizer * packetizer)
{
g_hash_table_foreach (packetizer->streams, foreach_stream_clear, packetizer);
+
+ /* FIXME can't use remove_all because we don't depend on 2.12 yet */
+ g_hash_table_foreach_remove (packetizer->streams, remove_all, NULL);
gst_adapter_clear (packetizer->adapter);
}
-
MpegTSPacketizer *
mpegts_packetizer_new ()
{