GNOME Bugzilla – Bug 590045
Query position fails when pipeline is paused and format is not time
Last modified: 2009-07-29 15:36:05 UTC
Please describe the problem: Calling gst_element_query_position() fails when the pipeline is in paused state and the format is GST_FORMAT_DEFAULT. Steps to reproduce: Actual results: Expected results: Does this happen every time? Other information: Excerpt from log when calling gst_element_query_position with GST_FORMAT_DEFAULT. GST_DEBUG="*sink*:5,*parse*:5" When in playing state -------------------------------------- 0:00:16.620629794 5226 0xb60004e0 DEBUG basesink gstbasesink.c:4479:gst_base_sink_query:<ximagesink0> position format 1 0:00:16.620701731 5226 0xb60004e0 DEBUG basesink gstbasesink.c:4224:gst_base_sink_get_position_last:<ximagesink0> POSITION: 99:99:99.999999999 0:00:16.620752505 5226 0xb60004e0 DEBUG basesink gstbasesink.c:4403:gst_base_sink_get_position:<ximagesink0> now 0:09:40.891340772 - base 0:09:40.211725692 - accum 0:00:00.000000000 + time 0:00:00.000000000 0:00:16.620814105 5226 0xb60004e0 DEBUG basesink gstbasesink.c:4457:gst_base_sink_get_position:<ximagesink0> convert failed, try upstream 0:00:16.620863413 5226 0xb60004e0 DEBUG rawparse gstrawparse.c:929:gst_raw_parse_src_query: src_query position 0:00:16.620900080 5226 0xb60004e0 LOG rawparse gstrawparse.c:937:gst_raw_parse_src_query: query position 0:00:16.620935699 5226 0xb60004e0 DEBUG rawparse gstrawparse.c:524:gst_raw_parse_convert: converting value 1000000000 from time (3) to default (1) 0:00:16.621010709 5226 0xb60004e0 DEBUG rawparse gstrawparse.c:610:gst_raw_parse_convert: ret=1 result 3 When in paused state ---------------------------------------- 0:00:18.172938612 5226 0x93673e8 DEBUG basesink gstbasesink.c:4479:gst_base_sink_query:<ximagesink0> position format 1 0:00:18.172992389 5226 0x93673e8 DEBUG basesink gstbasesink.c:4428:gst_base_sink_get_position:<ximagesink0> position in PAUSED 0:00:18.173032339 5226 0x93673e8 DEBUG basesink gstbasesink.c:4266:gst_base_sink_get_position_paused:<ximagesink0> POSITION as max: 0:00:01.000000000, time 0:00:00.000000000 0:00:18.173095685 5226 0x93673e8 DEBUG basesink gstbasesink.c:4415:gst_base_sink_get_position:<ximagesink0> res: 0, POSITION: 99:99:99.999999999
Created attachment 139406 [details] [review] Patch to query upstream about format conversion when it's necessary and pipeline is paused
Looks good, I'll push this after 0.10.24 release. commit 2ab7976cd69875fcc592f24733e1003ce4d80227 Author: Stian Selnes <stian.selnes@gmail.com> Date: Wed Jul 29 13:33:11 2009 +0200 basesink: Query upstream for the position if conversion in PAUSED failed Fixes bug #590045.
I have an improved patch that I will push as well.