From: Sebastian Dröge Date: Thu, 25 Jan 2007 23:27:59 +0000 (+0000) Subject: ext/wavpack/gstwavpackparse.c: Fix the SEEKING query. We can seek if we are in pull... X-Git-Tag: RELEASE-0_10_6~349 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0ccf6d499150b462fb04bd1c146b104f7e604bb6;p=platform%2Fupstream%2Fgst-plugins-good.git ext/wavpack/gstwavpackparse.c: Fix the SEEKING query. We can seek if we are in pull mode, not the other way around. A... Original commit message from CVS: * ext/wavpack/gstwavpackparse.c: (gst_wavpack_parse_src_query): Fix the SEEKING query. We can seek if we are in pull mode, not the other way around. Also set the correct format in the seeking query and handle the case where the headers are not read yet and we can't say anything about our seeking capabilities. --- diff --git a/ext/wavpack/gstwavpackparse.c b/ext/wavpack/gstwavpackparse.c index 47f6cd5..ed1de71 100644 --- a/ext/wavpack/gstwavpackparse.c +++ b/ext/wavpack/gstwavpackparse.c @@ -343,14 +343,17 @@ gst_wavpack_parse_src_query (GstPad * pad, GstQuery * query) gboolean seekable; gint64 duration = -1; - gst_pad_query_duration (pad, &format, &duration); + /* only fails if we didn't read the headers yet and can't say + * anything about our seeking capabilities */ + if (!gst_pad_query_duration (pad, &format, &duration)) + break; /* can't seek in streaming mode yet */ GST_OBJECT_LOCK (parse); - seekable = (parse->adapter != NULL); + seekable = (parse->adapter == NULL); GST_OBJECT_UNLOCK (parse); - gst_query_set_seeking (query, GST_FORMAT_TIME, seekable, 0, duration); + gst_query_set_seeking (query, format, seekable, 0, duration); ret = TRUE; } break;