From 389904f6248c65468175c072441747f51c5a5296 Mon Sep 17 00:00:00 2001 From: Alessandro Decina Date: Tue, 16 Oct 2007 16:51:23 +0000 Subject: gst/mpegtsparse/: Add request pad for getting the full transport stream coming in. Original commit message from CVS: patch by: Alessandro Decina * gst/mpegtsparse/mpegtspacketizer.c: * gst/mpegtsparse/mpegtsparse.c: * gst/mpegtsparse/mpegtsparse.h: Add request pad for getting the full transport stream coming in. --- gst/mpegtsparse/mpegtspacketizer.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'gst/mpegtsparse/mpegtspacketizer.c') diff --git a/gst/mpegtsparse/mpegtspacketizer.c b/gst/mpegtsparse/mpegtspacketizer.c index 000d0b3b..86d94b39 100644 --- a/gst/mpegtsparse/mpegtspacketizer.c +++ b/gst/mpegtsparse/mpegtspacketizer.c @@ -105,7 +105,8 @@ mpegts_packetizer_dispose (GObject * object) packetizer->disposed = TRUE; } - G_OBJECT_CLASS (mpegts_packetizer_parent_class)->dispose (object); + if (G_OBJECT_CLASS (mpegts_packetizer_parent_class)->dispose) + G_OBJECT_CLASS (mpegts_packetizer_parent_class)->dispose (object); } static gboolean @@ -128,7 +129,8 @@ mpegts_packetizer_finalize (GObject * object) stream_foreach_remove, packetizer); g_hash_table_destroy (packetizer->streams); - G_OBJECT_CLASS (mpegts_packetizer_parent_class)->finalize (object); + if (G_OBJECT_CLASS (mpegts_packetizer_parent_class)->finalize) + G_OBJECT_CLASS (mpegts_packetizer_parent_class)->finalize (object); } static gboolean @@ -142,20 +144,21 @@ mpegts_packetizer_parse_adaptation_field_control (MpegTSPacketizer * packetizer, if (packet->adaptation_field_control == 0x02) { /* no payload, adaptation field of 183 bytes */ if (length != 183) { - GST_WARNING ("PID %d afc == 0x%x and length %d != 183", + GST_DEBUG ("PID %d afc == 0x%x and length %d != 183", packet->pid, packet->adaptation_field_control, length); } } else if (length > 182) { - GST_WARNING ("PID %d afc == 0x%01x and length %d > 182", + GST_DEBUG ("PID %d afc == 0x%01x and length %d > 182", packet->pid, packet->adaptation_field_control, length); } /* skip the adaptation field body for now */ if (packet->data + length > packet->data_end) { - GST_ERROR ("PID %d afc length overflows the buffer %d", + GST_DEBUG ("PID %d afc length overflows the buffer %d", packet->pid, length); return FALSE; } + packet->data += length; return TRUE; @@ -280,7 +283,13 @@ mpegts_packetizer_parse_pat (MpegTSPacketizer * packetizer, g_value_unset (&value); } - g_assert (data == end - 4); + if (data != end - 4) { + /* FIXME: check the CRC before parsing the packet */ + GST_ERROR ("at the end of PAT data != end - 4"); + g_value_array_free (pat); + + return NULL; + } return pat; } -- cgit v1.2.1