mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-07-10 00:25:53 +00:00
gst/typefind/gsttypefindfunctions.c: Lower probability a bit if the marker isn't right at the start, to decrease the ...
Original commit message from CVS: * gst/typefind/gsttypefindfunctions.c: (mpeg2_sys_type_find): Lower probability a bit if the marker isn't right at the start, to decrease the chance of false positives.
This commit is contained in:
parent
c47074371a
commit
91773593cf
|
@ -1,3 +1,9 @@
|
||||||
|
2007-01-19 Tim-Philipp Müller <tim at centricular dot net>
|
||||||
|
|
||||||
|
* gst/typefind/gsttypefindfunctions.c: (mpeg2_sys_type_find):
|
||||||
|
Lower probability a bit if the marker isn't right at the start,
|
||||||
|
to decrease the chance of false positives.
|
||||||
|
|
||||||
2007-01-19 Tim-Philipp Müller <tim at centricular dot net>
|
2007-01-19 Tim-Philipp Müller <tim at centricular dot net>
|
||||||
|
|
||||||
* gst/typefind/gsttypefindfunctions.c: (mpeg2_sys_type_find):
|
* gst/typefind/gsttypefindfunctions.c: (mpeg2_sys_type_find):
|
||||||
|
|
|
@ -1034,7 +1034,7 @@ static GstStaticCaps mpeg_sys_caps = GST_STATIC_CAPS ("video/mpeg, "
|
||||||
static void
|
static void
|
||||||
mpeg2_sys_type_find (GstTypeFind * tf, gpointer unused)
|
mpeg2_sys_type_find (GstTypeFind * tf, gpointer unused)
|
||||||
{
|
{
|
||||||
guint8 *data;
|
guint8 *data, *data0;
|
||||||
gint mpegversion, len;
|
gint mpegversion, len;
|
||||||
|
|
||||||
len = MPEG2_MAX_PROBE_LENGTH * 2;
|
len = MPEG2_MAX_PROBE_LENGTH * 2;
|
||||||
|
@ -1046,6 +1046,7 @@ mpeg2_sys_type_find (GstTypeFind * tf, gpointer unused)
|
||||||
if (!data)
|
if (!data)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
data0 = data;
|
||||||
while (len > 0) {
|
while (len > 0) {
|
||||||
if (IS_MPEG_PACK_HEADER (data)) {
|
if (IS_MPEG_PACK_HEADER (data)) {
|
||||||
if ((data[4] & 0xC0) == 0x40) {
|
if ((data[4] & 0xC0) == 0x40) {
|
||||||
|
@ -1071,7 +1072,11 @@ suggest:
|
||||||
|
|
||||||
gst_structure_set (gst_caps_get_structure (caps, 0), "mpegversion",
|
gst_structure_set (gst_caps_get_structure (caps, 0), "mpegversion",
|
||||||
G_TYPE_INT, mpegversion, NULL);
|
G_TYPE_INT, mpegversion, NULL);
|
||||||
gst_type_find_suggest (tf, GST_TYPE_FIND_POSSIBLE, caps);
|
/* lower probability if the marker isn't right at the start */
|
||||||
|
if (data0 == data)
|
||||||
|
gst_type_find_suggest (tf, GST_TYPE_FIND_POSSIBLE, caps);
|
||||||
|
else
|
||||||
|
gst_type_find_suggest (tf, GST_TYPE_FIND_POSSIBLE - 10, caps);
|
||||||
gst_caps_unref (caps);
|
gst_caps_unref (caps);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue