From 504f9c7a6c90e14714560ce490d1eebd69978e79 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Sun, 14 Mar 2010 11:47:23 +0100 Subject: [PATCH] typefind: deactivate pad if we can't get length or it's a length of zero. Fixes issues when re-using typefind after a file of length zero. --- plugins/elements/gsttypefindelement.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/elements/gsttypefindelement.c b/plugins/elements/gsttypefindelement.c index 4b5e2da6fc..433dbb9438 100644 --- a/plugins/elements/gsttypefindelement.c +++ b/plugins/elements/gsttypefindelement.c @@ -929,6 +929,7 @@ gst_type_find_element_activate (GstPad * pad) if (!gst_pad_query_duration (peer, &format, &size)) { GST_WARNING_OBJECT (typefind, "Could not query upstream length!"); gst_object_unref (peer); + gst_pad_activate_pull (pad, FALSE); return FALSE; } @@ -938,6 +939,7 @@ gst_type_find_element_activate (GstPad * pad) GST_ELEMENT_ERROR (typefind, STREAM, TYPE_NOT_FOUND, (_("Stream contains no data.")), ("Can't typefind empty stream")); gst_object_unref (peer); + gst_pad_activate_pull (pad, FALSE); return FALSE; } ext = gst_type_find_get_extension (typefind, pad); @@ -960,6 +962,7 @@ gst_type_find_element_activate (GstPad * pad) */ if (typefind->mode == MODE_NORMAL) { /* this means we already emitted typefound */ + GST_DEBUG ("Already managed to typefind !"); goto really_done; } -- 2.34.1