Commit b6764dcc authored by Wim Taymans's avatar Wim Taymans

ext/ogg/gstoggdemux.c: Also FLUSH upstream, makes the loop function exit faster.

Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_activate_chain),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_clear_chains):
Also FLUSH upstream, makes the loop function exit faster.

* ext/theora/theoradec.c: (theora_dec_src_query):
Some more debug info in the query.

* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new),
(gst_ximagesink_setcaps):
Release lock on par error, better error reporting.
parent 70fbbf75
2005-05-30 Wim Taymans <wim@fluendo.com>
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_activate_chain),
(gst_ogg_demux_perform_seek), (gst_ogg_demux_clear_chains):
Also FLUSH upstream, makes the loop function exit faster.
* ext/theora/theoradec.c: (theora_dec_src_query):
Some more debug info in the query.
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new),
(gst_ximagesink_setcaps):
Release lock on par error, better error reporting.
2005-05-26 Wim Taymans <wim@fluendo.com>
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_submit_packet),
......
......@@ -1225,11 +1225,14 @@ gst_ogg_demux_perform_seek (GstOggDemux * ogg, gint64 pos)
{
gint i;
gst_pad_push_event (ogg->sinkpad, gst_event_new_flush (FALSE));
GST_CHAIN_LOCK (ogg);
for (i = 0; i < ogg->chains->len; i++) {
GstOggChain *chain = g_array_index (ogg->chains, GstOggChain *, i);
gint j;
for (j = 0; j < chain->streams->len; j++) {
GstOggPad *pad = g_array_index (chain->streams, GstOggPad *, j);
......@@ -1242,6 +1245,11 @@ gst_ogg_demux_perform_seek (GstOggDemux * ogg, gint64 pos)
/* now grab the stream lock so that streaming cannot continue */
GST_STREAM_LOCK (ogg->sinkpad);
/* we need to stop flushing on the srcpad as w're going to use it
* next. We can do this as we have the STREAM lock now. */
gst_pad_push_event (ogg->sinkpad, gst_event_new_flush (TRUE));
{
gint i;
......
......@@ -418,7 +418,6 @@ theora_dec_src_query (GstPad * pad, GstQuery * query)
switch (GST_QUERY_TYPE (query)) {
case GST_QUERY_POSITION:
{
gboolean res;
gint64 granulepos, total, value;
GstFormat my_format, format;
gint64 time;
......@@ -430,9 +429,16 @@ theora_dec_src_query (GstPad * pad, GstQuery * query)
/* we can convert a granule position to everything */
granulepos = dec->granulepos;
GST_LOG_OBJECT (dec,
"query %p: we have current granule: %lld", query, granulepos);
/* parse total time from peer and format */
gst_query_parse_position (query, &format, NULL, &total);
GST_LOG_OBJECT (dec,
"query %p: peer returned total: %lld (format %u)",
query, total, format);
/* and convert to the final format in two steps with time as the
* intermediate step */
my_format = GST_FORMAT_TIME;
......@@ -441,6 +447,9 @@ theora_dec_src_query (GstPad * pad, GstQuery * query)
granulepos, &my_format, &time)))
goto error;
GST_LOG_OBJECT (dec,
"query %p: our time: %" GST_TIME_FORMAT, query, GST_TIME_ARGS (time));
if (!(res =
theora_dec_src_convert (pad, my_format, time, &format, &value)))
goto error;
......@@ -448,10 +457,9 @@ theora_dec_src_query (GstPad * pad, GstQuery * query)
gst_query_set_position (query, format, value, total);
GST_LOG_OBJECT (dec,
"query %u: peer returned granulepos: %llu - we return %llu (format %u)",
query, granulepos, value, format);
"query %p: we return %lld and %lld (format %u)",
query, value, total, format);
res = TRUE;
break;
}
case GST_QUERY_CONVERT:
......@@ -460,18 +468,22 @@ theora_dec_src_query (GstPad * pad, GstQuery * query)
gint64 src_val, dest_val;
gst_query_parse_convert (query, &src_fmt, &src_val, &dest_fmt, &dest_val);
if ((res =
if (!(res =
theora_dec_src_convert (pad, src_fmt, src_val, &dest_fmt,
&dest_val)))
gst_query_set_convert (query, src_fmt, src_val, dest_fmt, dest_val);
goto error;
gst_query_set_convert (query, src_fmt, src_val, dest_fmt, dest_val);
break;
}
default:
res = FALSE;
break;
}
return res;
error:
GST_DEBUG ("query failed");
return res;
}
......
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