summaryrefslogtreecommitdiffstats
path: root/gst/mpegtsparse/mpegtspacketizer.c
diff options
context:
space:
mode:
authorAlessandro Decina <alessandro@nnva.org>2007-10-16 16:51:23 +0000
committerZaheer Abbas Merali <zaheerabbas@merali.org>2007-10-16 16:51:23 +0000
commit389904f6248c65468175c072441747f51c5a5296 (patch)
tree819c1e15fcf7ef0d2068879e953ebfef2a5ea414 /gst/mpegtsparse/mpegtspacketizer.c
parent93ee0f26d9139729efbc6f20f6295d3ef12953e9 (diff)
downloadgst-plugins-bad-389904f6248c65468175c072441747f51c5a5296.tar.gz
gst-plugins-bad-389904f6248c65468175c072441747f51c5a5296.tar.bz2
gst-plugins-bad-389904f6248c65468175c072441747f51c5a5296.zip
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.
Diffstat (limited to 'gst/mpegtsparse/mpegtspacketizer.c')
-rw-r--r--gst/mpegtsparse/mpegtspacketizer.c21
1 files changed, 15 insertions, 6 deletions
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;
}