GNOME Bugzilla – Bug 678386
[matroskademux] Returns TRUE for unsupported POSITION/DURATION queries
Last modified: 2012-06-26 09:03:17 UTC
Created attachment 216729 [details] Playback tutorial 3 from the GStreamer SDK Although there seems to be code in basesink to handle Position Queries in Percent format, it fails in all the sinks I tested (ximage and d3dvideosink): The query returns TRUE, but position is GST_CLOCK_TIME_NONE. If line 79 of the attached code is changed to GstFormat format = GST_FORMAT_PERCENT; instead of GST_FORMAT_TIME, all queries will fail.
This change in gst-plugins-good makes it almost work: commit 8cbaaba94885486cb124892aad6d36dc7925b922 Author: Sebastian Dröge <sebastian.droege@collabora.co.uk> Date: Mon Jun 25 13:31:16 2012 +0200 matroskademux: Return FALSE from queries if we can't answer POSITION/DURATION queries Additionally your validity checks for the duration are not correct. It will return 0xffffffffffffffff as duration in percent, and that is not a valid clock time. Just use GST_FORMAT_PERCENT_MAX instead of querying the duration in percent. Then everything works. Also don't use GST_CLOCK_TIME_IS_VALID() on the position in percentage either.