Commit 170e28dc authored by Benjamin Otte's avatar Benjamin Otte
Browse files

ext/ogg/gstoggdemux.c: make sure to handle the case where there's no current chain gracefully.

Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_get_pad_by_pad),
(gst_ogg_demux_src_query):
make sure to handle the case where there's no current chain
gracefully.
parent f0365ebe
2004-03-06 Benjamin Otte <otte@gnome.org>
* ext/ogg/gstoggdemux.c: (gst_ogg_get_pad_by_pad),
(gst_ogg_demux_src_query):
make sure to handle the case where there's no current chain
gracefully.
2004-03-05 David Schleef <ds@schleef.org> 2004-03-05 David Schleef <ds@schleef.org>
* ext/aalib/gstaasink.c: (gst_aasink_fixate), (gst_aasink_init): * ext/aalib/gstaasink.c: (gst_aasink_fixate), (gst_aasink_init):
......
...@@ -272,6 +272,10 @@ gst_ogg_get_pad_by_pad (GstOggDemux *ogg, GstPad *pad) ...@@ -272,6 +272,10 @@ gst_ogg_get_pad_by_pad (GstOggDemux *ogg, GstPad *pad)
GSList *walk; GSList *walk;
GstOggPad *cur; GstOggPad *cur;
if (ogg->current_chain == -1) {
GST_DEBUG_OBJECT (ogg, "no active chain, returning NULL");
return NULL;
}
for (walk = CURRENT_CHAIN (ogg)->pads; walk; walk = g_slist_next (walk)) { for (walk = CURRENT_CHAIN (ogg)->pads; walk; walk = g_slist_next (walk)) {
cur = (GstOggPad *) walk->data; cur = (GstOggPad *) walk->data;
if (cur->pad == pad) if (cur->pad == pad)
...@@ -288,6 +292,9 @@ gst_ogg_demux_src_query (GstPad *pad, GstQueryType type, ...@@ -288,6 +292,9 @@ gst_ogg_demux_src_query (GstPad *pad, GstQueryType type,
GstOggDemux *ogg = GST_OGG_DEMUX (gst_pad_get_parent (pad)); GstOggDemux *ogg = GST_OGG_DEMUX (gst_pad_get_parent (pad));
GstOggPad *cur = gst_ogg_get_pad_by_pad (ogg, pad); GstOggPad *cur = gst_ogg_get_pad_by_pad (ogg, pad);
if (!cur)
return FALSE;
switch (type) { switch (type) {
case GST_QUERY_TOTAL: { case GST_QUERY_TOTAL: {
if (*format == GST_FORMAT_DEFAULT) { if (*format == GST_FORMAT_DEFAULT) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment