diff options
-rw-r--r-- | ChangeLog | 11 | ||||
-rw-r--r-- | gst/mpegtsparse/mpegtspacketizer.c | 15 |
2 files changed, 23 insertions, 3 deletions
@@ -1,5 +1,16 @@ 2007-11-15 Wim Taymans <wim.taymans@gmail.com> + 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. + +2007-11-15 Wim Taymans <wim.taymans@gmail.com> + Patch by: Wouter Paesen <wouter at blue-gate dot be> * ext/soundtouch/gstpitch.cc: 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 () { |