diff options
author | Wim Taymans <wim.taymans@gmail.com> | 2005-05-30 16:34:46 +0000 |
---|---|---|
committer | Wim Taymans <wim.taymans@gmail.com> | 2005-05-30 16:34:46 +0000 |
commit | b6764dcc97929eb065042d89a335251e4afffb67 (patch) | |
tree | 948c2d249c82dad66b533e8339d085e1cae7ab23 | |
parent | 70fbbf750b8b801d00ae333821748e717c9170ec (diff) |
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.
-rw-r--r-- | ChangeLog | 13 | ||||
-rw-r--r-- | ext/ogg/gstoggdemux.c | 8 | ||||
-rw-r--r-- | ext/theora/theoradec.c | 24 |
3 files changed, 39 insertions, 6 deletions
@@ -1,3 +1,16 @@ +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), diff --git a/ext/ogg/gstoggdemux.c b/ext/ogg/gstoggdemux.c index 85974c77e..d3d6e4da3 100644 --- a/ext/ogg/gstoggdemux.c +++ b/ext/ogg/gstoggdemux.c @@ -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; diff --git a/ext/theora/theoradec.c b/ext/theora/theoradec.c index b95d01c80..63fb58e30 100644 --- a/ext/theora/theoradec.c +++ b/ext/theora/theoradec.c @@ -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; } |