[gstreamer-bugs] [Bug 161262] [playbin] cannot play a pes mpeg file
bugzilla-daemon at bugzilla.gnome.org
bugzilla-daemon at bugzilla.gnome.org
Tue Dec 14 08:27:10 PST 2004
http://bugzilla.gnome.org/show_bug.cgi?id=161262
GStreamer | gst-plugins | Ver: HEAD CVS
------- Additional Comments From zaheerabbas at merali.org 2004-12-14 11:27 -------
Here is the patch to make it found by typefind:
diff -u -r1.61 gsttypefindfunctions.c
--- gsttypefindfunctions.c 25 Nov 2004 20:14:32 -0000 1.61
+++ gsttypefindfunctions.c 14 Dec 2004 16:25:09 -0000
@@ -544,6 +544,13 @@
(((guint8 *)data)[1] == 0x00) && \
(((guint8 *)data)[2] == 0x01) && \
((((guint8 *)data)[3] & 0x80) == 0x80))
+#define IS_MPEG_PES_HEADER(data) ((((guint8 *)data)[0] == 0x00) && \
+ (((guint8 *)data)[1] == 0x00) && \
+ (((guint8 *)data)[2] == 0x01) && \
+ ((((guint8 *)data)[3] == 0xE0) || \
+ (((guint8 *)data)[3] == 0xC0) || \
+ (((guint8 *)data)[3] == 0xBD)))
+
static void
mpeg2_sys_type_find (GstTypeFind * tf, gpointer unused)
{
@@ -566,6 +573,15 @@
gst_caps_free (caps);
}
}
+ else if (data && IS_MPEG_PES_HEADER (data)) {
+ /* PES stream */
+ GstCaps *caps = gst_caps_copy (MPEG_SYS_CAPS);
+
+ gst_structure_set (gst_caps_get_structure (caps, 0), "mpegversion",
+ G_TYPE_INT, 2, 0);
+ gst_type_find_suggest (tf, GST_TYPE_FIND_MAXIMUM, caps);
+ }
+
};
/* ATTANTION: ugly return value:
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are the QA contact for the bug.
More information about the Gstreamer-bugs
mailing list