RESOLVED FIXED 29999
[GStreamer] Should handle unknown duration better
https://bugs.webkit.org/show_bug.cgi?id=29999
Summary [GStreamer] Should handle unknown duration better
Sebastian Dröge (slomo)
Reported 2009-10-02 01:28:41 PDT
Hi, currently there's only a check for -1 duration if GStreamer before 0.10.23 is used. This is wrong, you should always check if a) returned duration is != -1 (<= 0 is wrong, it could be <-1 because in TIME format it really is an unsigned integer with -1 as special value) b) fmt is still GST_FORMAT_TIME in case a) and b) are not true the duration is simply unknown.
Attachments
patch for duration query (2.67 KB, patch)
2009-10-06 02:17 PDT, Benjamin Otte
no flags
patch for duration query, try 2 (2.60 KB, patch)
2009-10-07 07:06 PDT, Benjamin Otte
jmalonzo: review+
jmalonzo: commit-queue-
Sebastian Dröge (slomo)
Comment 1 2009-10-02 01:42:41 PDT
Sames goes for the query_duration() calls in BYTE format btw.
Benjamin Otte
Comment 2 2009-10-06 02:17:23 PDT
Created attachment 40703 [details] patch for duration query Here's a patch for the time duration query. I'm not flagging it for review yet even though I'm pretty sure it's correct, but I'd like Sebastian to look it over just to be sure.
Sebastian Dröge (slomo)
Comment 3 2009-10-06 03:01:06 PDT
Almost correct, yes. Just remove the complete GStreamer version check and only check for time!=GST_CLOCK_TIME_NONE. "negative" times are always ok because the time really is a unsigned integer.
Benjamin Otte
Comment 4 2009-10-07 07:06:44 PDT
Created attachment 40785 [details] patch for duration query, try 2
Sebastian Dröge (slomo)
Comment 5 2009-10-12 03:36:20 PDT
Looks good to me
Jan Alonzo
Comment 6 2009-10-13 03:10:49 PDT
Comment on attachment 40785 [details] patch for duration query, try 2 > + if (!gst_element_query_duration(m_playBin, &timeFormat, &timeLength) || > + timeFormat != GST_FORMAT_TIME || > + timeLength == GST_CLOCK_TIME_NONE) { We don't normally break the expression into multiple lines. I'll fix it up when landing. Is it possible to test this or is this covered by our existing tests already? r=me.
Jan Alonzo
Comment 7 2009-10-19 04:58:52 PDT
(In reply to comment #6) > (From update of attachment 40785 [details]) > > > + if (!gst_element_query_duration(m_playBin, &timeFormat, &timeLength) || > > + timeFormat != GST_FORMAT_TIME || > > + timeLength == GST_CLOCK_TIME_NONE) { > > We don't normally break the expression into multiple lines. I'll fix it up when > landing. > > Is it possible to test this or is this covered by our existing tests already? > > r=me. Landed as http://trac.webkit.org/changeset/49774
Note You need to log in before you can comment on or make changes to this bug.