mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-07 16:08:51 +00:00
gst/gstelement.c: make elements try to recursively change state to PAUSED on all parents after an error to suppress e...
Original commit message from CVS: * gst/gstelement.c: (gst_element_error_full): make elements try to recursively change state to PAUSED on all parents after an error to suppress ensuing warnings * gst/parse/grammar.y: make it check if it was able to sync the state, and throw an error if not, so stuff like oggdemux ! vorbisdec ! osssink gets caught
This commit is contained in:
parent
65ff7c960b
commit
674e6a9a02
3 changed files with 35 additions and 7 deletions
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
||||||
|
2004-03-05 Thomas Vander Stichele <thomas at apestaart dot org>
|
||||||
|
|
||||||
|
* gst/gstelement.c: (gst_element_error_full):
|
||||||
|
make elements try to recursively change state to PAUSED on all
|
||||||
|
parents after an error to suppress ensuing warnings
|
||||||
|
* gst/parse/grammar.y:
|
||||||
|
make it check if it was able to sync the state, and throw an error
|
||||||
|
if not, so stuff like
|
||||||
|
oggdemux ! vorbisdec ! osssink gets caught
|
||||||
|
|
||||||
2004-03-05 Thomas Vander Stichele <thomas at apestaart dot org>
|
2004-03-05 Thomas Vander Stichele <thomas at apestaart dot org>
|
||||||
|
|
||||||
* configure.ac: use ${libdir} for PLUGINS_DIR since on 64bit
|
* configure.ac: use ${libdir} for PLUGINS_DIR since on 64bit
|
||||||
|
|
|
@ -2412,6 +2412,7 @@ gst_element_error_full
|
||||||
const gchar *file, const gchar *function, gint line)
|
const gchar *file, const gchar *function, gint line)
|
||||||
{
|
{
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
|
GstElement *e = NULL;
|
||||||
gchar *name;
|
gchar *name;
|
||||||
gchar *sent_message;
|
gchar *sent_message;
|
||||||
gchar *sent_debug;
|
gchar *sent_debug;
|
||||||
|
@ -2475,14 +2476,22 @@ gst_element_error_full
|
||||||
gst_scheduler_error (element->sched, element);
|
gst_scheduler_error (element->sched, element);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GST_STATE (element) == GST_STATE_PLAYING) {
|
/* recursively leave PLAYING state */
|
||||||
GstElementStateReturn ret;
|
e = element;
|
||||||
|
while (e)
|
||||||
|
{
|
||||||
|
if (GST_STATE (e) == GST_STATE_PLAYING) {
|
||||||
|
GstElementStateReturn ret;
|
||||||
|
|
||||||
ret = gst_element_set_state (element, GST_STATE_PAUSED);
|
ret = gst_element_set_state (e, GST_STATE_PAUSED);
|
||||||
if (ret != GST_STATE_SUCCESS) {
|
/* only check if this worked for current element, not parents, since
|
||||||
g_warning ("could not PAUSE element \"%s\" after error, help!",
|
this is likely to fail anyway */
|
||||||
GST_ELEMENT_NAME (element));
|
if (ret != GST_STATE_SUCCESS && e == element) {
|
||||||
|
g_warning ("could not PAUSE element \"%s\" after error, help!",
|
||||||
|
GST_ELEMENT_NAME (e));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
e = GST_ELEMENT (GST_ELEMENT_PARENT (e));
|
||||||
}
|
}
|
||||||
|
|
||||||
GST_FLAG_UNSET (element, GST_ELEMENT_IN_ERROR);
|
GST_FLAG_UNSET (element, GST_ELEMENT_IN_ERROR);
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
#include "../gstconfig.h"
|
#include "../gstconfig.h"
|
||||||
#include "../gstparse.h"
|
#include "../gstparse.h"
|
||||||
#include "../gstinfo.h"
|
#include "../gstinfo.h"
|
||||||
|
#include "../gsterror.h"
|
||||||
#include "../gsturi.h"
|
#include "../gsturi.h"
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
|
|
||||||
|
@ -370,9 +371,17 @@ gst_parse_element_lock (GstElement *element, gboolean lock)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(lock && unlocked_peer)) {
|
if (!(lock && unlocked_peer)) {
|
||||||
|
GST_CAT_DEBUG (GST_CAT_PIPELINE, "setting locked state on element");
|
||||||
gst_element_set_locked_state (element, lock);
|
gst_element_set_locked_state (element, lock);
|
||||||
if (!lock)
|
if (!lock)
|
||||||
gst_element_sync_state_with_parent (element);
|
{
|
||||||
|
/* try to sync state with parent */
|
||||||
|
GST_CAT_DEBUG (GST_CAT_PIPELINE, "trying to sync state of element with parent");
|
||||||
|
/* FIXME: it would be nice if we can figure out why it failed
|
||||||
|
(e.g. caps nego) and give an error about that instead. */
|
||||||
|
if (!gst_element_sync_state_with_parent (element))
|
||||||
|
GST_ELEMENT_ERROR (element, CORE, STATE_CHANGE, (NULL), (NULL));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue