mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-24 08:08:22 +00:00
plugins/elements/gsttypefindelement.c: When we get an EOS event and have not found a type yet (most likely because we...
Original commit message from CVS: * plugins/elements/gsttypefindelement.c: (gst_type_find_element_handle_event): When we get an EOS event and have not found a type yet (most likely because we had not yet accumulated TYPE_FIND_MIN_SIZE of data yet), try to determine the type given the data we have so far. Fixes typefinding for very short streams again, most notably quicktime redirections as used on Apple's trailer site (#331701).
This commit is contained in:
parent
aad2aa1288
commit
e4d393eb66
2 changed files with 24 additions and 9 deletions
11
ChangeLog
11
ChangeLog
|
@ -1,3 +1,14 @@
|
||||||
|
2006-02-27 Tim-Philipp Müller <tim at centricular dot net>
|
||||||
|
|
||||||
|
* plugins/elements/gsttypefindelement.c:
|
||||||
|
(gst_type_find_element_handle_event):
|
||||||
|
When we get an EOS event and have not found a type yet
|
||||||
|
(most likely because we had not yet accumulated
|
||||||
|
TYPE_FIND_MIN_SIZE of data yet), try to determine the
|
||||||
|
type given the data we have so far. Fixes typefinding
|
||||||
|
for very short streams again, most notably quicktime
|
||||||
|
redirections as used on Apple's trailer site (#331701).
|
||||||
|
|
||||||
2006-02-27 Tim-Philipp Müller <tim at centricular dot net>
|
2006-02-27 Tim-Philipp Müller <tim at centricular dot net>
|
||||||
|
|
||||||
* libs/gst/base/gsttypefindhelper.c: (type_find_factory_rank_cmp),
|
* libs/gst/base/gsttypefindhelper.c: (type_find_factory_rank_cmp),
|
||||||
|
|
|
@ -559,20 +559,24 @@ gst_type_find_element_handle_event (GstPad * pad, GstEvent * event)
|
||||||
case MODE_TYPEFIND:
|
case MODE_TYPEFIND:
|
||||||
switch (GST_EVENT_TYPE (event)) {
|
switch (GST_EVENT_TYPE (event)) {
|
||||||
case GST_EVENT_EOS:{
|
case GST_EVENT_EOS:{
|
||||||
TypeFindEntry *entry;
|
GstTypeFindProbability prob;
|
||||||
|
GstCaps *caps;
|
||||||
|
|
||||||
entry = gst_type_find_element_get_best_possibility (typefind);
|
GST_INFO_OBJECT (typefind, "Got EOS and no type found yet");
|
||||||
|
|
||||||
if (entry && entry->probability >= typefind->min_probability) {
|
/* we might not have started typefinding yet because there was not
|
||||||
GST_INFO_OBJECT (typefind,
|
* enough data so far; just give it a shot now and see what we get */
|
||||||
"'%s' is the best typefind left after we got all data, using it now (probability %u)",
|
caps = gst_type_find_helper_for_buffer (GST_OBJECT (typefind),
|
||||||
GST_PLUGIN_FEATURE_NAME (entry->factory), entry->probability);
|
typefind->store, &prob);
|
||||||
|
|
||||||
|
if (caps && prob >= typefind->min_probability) {
|
||||||
g_signal_emit (typefind, gst_type_find_element_signals[HAVE_TYPE],
|
g_signal_emit (typefind, gst_type_find_element_signals[HAVE_TYPE],
|
||||||
0, entry->probability, entry->caps);
|
0, prob, caps);
|
||||||
} else {
|
} else {
|
||||||
GST_ELEMENT_ERROR (typefind, STREAM, TYPE_NOT_FOUND, (NULL),
|
GST_ELEMENT_ERROR (typefind, STREAM, TYPE_NOT_FOUND,
|
||||||
(NULL));
|
(NULL), (NULL));
|
||||||
}
|
}
|
||||||
|
gst_caps_replace (&caps, NULL);
|
||||||
stop_typefinding (typefind);
|
stop_typefinding (typefind);
|
||||||
res = gst_pad_event_default (pad, event);
|
res = gst_pad_event_default (pad, event);
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue