gst/typefind/gsttypefindfunctions.c: In case we can't find the required number of consecutive mpeg audio frames to po...
Original commit message from CVS: * gst/typefind/gsttypefindfunctions.c: (mp3_type_find): In case we can't find the required number of consecutive mpeg audio frames to positively identify an MPEG audio stream, check if there's at least a valid mpeg audio frame right at offset 0 and if so suggest mpeg/audio caps with a very low probability (#153004).
This commit is contained in:
parent
b067983614
commit
0475a8b14c
@ -1,3 +1,12 @@
|
|||||||
|
2006-02-07 Tim-Philipp Müller <tim at centricular dot net>
|
||||||
|
|
||||||
|
* gst/typefind/gsttypefindfunctions.c: (mp3_type_find):
|
||||||
|
In case we can't find the required number of consecutive
|
||||||
|
mpeg audio frames to positively identify an MPEG audio
|
||||||
|
stream, check if there's at least a valid mpeg audio
|
||||||
|
frame right at offset 0 and if so suggest mpeg/audio
|
||||||
|
caps with a very low probability (#153004).
|
||||||
|
|
||||||
2006-02-07 Andy Wingo <wingo@pobox.com>
|
2006-02-07 Andy Wingo <wingo@pobox.com>
|
||||||
|
|
||||||
* gst/tcp/gsttcpclientsrc.c (gst_tcp_client_src_create): Switch to
|
* gst/tcp/gsttcpclientsrc.c (gst_tcp_client_src_create): Switch to
|
||||||
|
@ -553,7 +553,7 @@ mp3_type_find (GstTypeFind * tf, gpointer unused)
|
|||||||
guint64 start_off = (try == 0) ? 0 : length / 2;
|
guint64 start_off = (try == 0) ? 0 : length / 2;
|
||||||
|
|
||||||
if (try != 0 && start_off == 0)
|
if (try != 0 && start_off == 0)
|
||||||
return;
|
break;
|
||||||
|
|
||||||
size = 0;
|
size = 0;
|
||||||
skipped = 0;
|
skipped = 0;
|
||||||
@ -660,8 +660,9 @@ mp3_type_find (GstTypeFind * tf, gpointer unused)
|
|||||||
G_TYPE_INT, layer, NULL);
|
G_TYPE_INT, layer, NULL);
|
||||||
gst_type_find_suggest (tf, probability, caps);
|
gst_type_find_suggest (tf, probability, caps);
|
||||||
gst_caps_unref (caps);
|
gst_caps_unref (caps);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
return;
|
goto no_luck;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
data++;
|
data++;
|
||||||
@ -669,6 +670,25 @@ mp3_type_find (GstTypeFind * tf, gpointer unused)
|
|||||||
size--;
|
size--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
no_luck:
|
||||||
|
|
||||||
|
/* no luck so far, let's see if there's a valid header right at the start */
|
||||||
|
data = gst_type_find_peek (tf, 0, 4); /* use min. frame size? */
|
||||||
|
if (data) {
|
||||||
|
GstCaps *caps;
|
||||||
|
guint layer;
|
||||||
|
|
||||||
|
if (mp3_type_frame_length_from_header (GST_READ_UINT32_BE (data),
|
||||||
|
&layer, NULL, NULL, NULL, NULL, 0) != 0) {
|
||||||
|
caps = gst_caps_copy (MP3_CAPS);
|
||||||
|
gst_structure_set (gst_caps_get_structure (caps, 0), "layer",
|
||||||
|
G_TYPE_INT, layer, NULL);
|
||||||
|
GST_LOG ("possible mpeg audio layer %u frame at offset 0", layer);
|
||||||
|
gst_type_find_suggest (tf, GST_TYPE_FIND_POSSIBLE - 10, caps);
|
||||||
|
gst_caps_unref (caps);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*** audio/x-ac3 ***/
|
/*** audio/x-ac3 ***/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user