summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim.muller@collabora.co.uk>2012-07-17 20:54:45 +0100
committerTim-Philipp Müller <tim.muller@collabora.co.uk>2012-07-17 20:57:39 +0100
commitd6dbd2094ec83765248ce382912cfc2f6bef73f8 (patch)
tree6e545a31d16bd87aba6c12117fd21a6474cf3f00 /ext
parentff9aa50bc8c8576a15835ef9b67fe5157f349c76 (diff)
dvdreadsrc: mustn't drop queries like caps query if not started yet
Diffstat (limited to 'ext')
-rw-r--r--ext/dvdread/dvdreadsrc.c34
1 files changed, 19 insertions, 15 deletions
diff --git a/ext/dvdread/dvdreadsrc.c b/ext/dvdread/dvdreadsrc.c
index dfc387a5..ca0bf551 100644
--- a/ext/dvdread/dvdreadsrc.c
+++ b/ext/dvdread/dvdreadsrc.c
@@ -1550,35 +1550,39 @@ static gboolean
gst_dvd_read_src_src_query (GstBaseSrc * basesrc, GstQuery * query)
{
GstDvdReadSrc *src = GST_DVD_READ_SRC (basesrc);
- gboolean started;
gboolean res = TRUE;
- GST_LOG_OBJECT (src, "handling %s query",
- gst_query_type_get_name (GST_QUERY_TYPE (query)));
-
- GST_OBJECT_LOCK (src);
- started = (GST_OBJECT_FLAG_IS_SET (src, GST_BASE_SRC_FLAG_STARTED));
- GST_OBJECT_UNLOCK (src);
-
- if (!started) {
- GST_DEBUG_OBJECT (src, "query failed: not started");
- return FALSE;
- }
+ GST_LOG_OBJECT (src, "handling %s query", GST_QUERY_TYPE_NAME (query));
switch (GST_QUERY_TYPE (query)) {
case GST_QUERY_DURATION:
GST_OBJECT_LOCK (src);
- res = gst_dvd_read_src_do_duration_query (src, query);
+ if (GST_OBJECT_FLAG_IS_SET (src, GST_BASE_SRC_FLAG_STARTED)) {
+ res = gst_dvd_read_src_do_duration_query (src, query);
+ } else {
+ GST_DEBUG_OBJECT (src, "query failed: not started");
+ res = FALSE;
+ }
GST_OBJECT_UNLOCK (src);
break;
case GST_QUERY_POSITION:
GST_OBJECT_LOCK (src);
- res = gst_dvd_read_src_do_position_query (src, query);
+ if (GST_OBJECT_FLAG_IS_SET (src, GST_BASE_SRC_FLAG_STARTED)) {
+ res = gst_dvd_read_src_do_position_query (src, query);
+ } else {
+ GST_DEBUG_OBJECT (src, "query failed: not started");
+ res = FALSE;
+ }
GST_OBJECT_UNLOCK (src);
break;
case GST_QUERY_CONVERT:
GST_OBJECT_LOCK (src);
- res = gst_dvd_read_src_do_convert_query (src, query);
+ if (GST_OBJECT_FLAG_IS_SET (src, GST_BASE_SRC_FLAG_STARTED)) {
+ res = gst_dvd_read_src_do_convert_query (src, query);
+ } else {
+ GST_DEBUG_OBJECT (src, "query failed: not started");
+ res = FALSE;
+ }
GST_OBJECT_UNLOCK (src);
break;
default: