Title: [138364] trunk/Source/WebCore
- Revision
- 138364
- Author
- [email protected]
- Date
- 2012-12-21 02:46:53 -0800 (Fri, 21 Dec 2012)
Log Message
[GStreamer] Buffering ranges are reported incorrectly with GStreamer 1.0
https://bugs.webkit.org/show_bug.cgi?id=105319
Patch by Xabier Rodriguez Calvar <[email protected]> on 2012-12-21
Reviewed by Philippe Normand.
We add the gPercentMax constant to select between 100 and
GST_FORMAT_PERCENT_MAX depending if we are compiling against
GStreamer 0.10 or 1.0 and we use that in the corresponding method.
Current tests should suffice.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::buffered): Added the use of
gPercentMax constant instead of 100 to have the different code
paths for GStreamer 0.10 and 1.0.
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (138363 => 138364)
--- trunk/Source/WebCore/ChangeLog 2012-12-21 10:46:43 UTC (rev 138363)
+++ trunk/Source/WebCore/ChangeLog 2012-12-21 10:46:53 UTC (rev 138364)
@@ -1,3 +1,21 @@
+2012-12-21 Xabier Rodriguez Calvar <[email protected]>
+
+ [GStreamer] Buffering ranges are reported incorrectly with GStreamer 1.0
+ https://bugs.webkit.org/show_bug.cgi?id=105319
+
+ Reviewed by Philippe Normand.
+
+ We add the gPercentMax constant to select between 100 and
+ GST_FORMAT_PERCENT_MAX depending if we are compiling against
+ GStreamer 0.10 or 1.0 and we use that in the corresponding method.
+
+ Current tests should suffice.
+
+ * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+ (WebCore::MediaPlayerPrivateGStreamer::buffered): Added the use of
+ gPercentMax constant instead of 100 to have the different code
+ paths for GStreamer 0.10 and 1.0.
+
2012-12-21 Tim Horton <[email protected]>
PDFPlugin: Cannot drop files/URLs on PDFPlugin
Modified: trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp (138363 => 138364)
--- trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp 2012-12-21 10:46:43 UTC (rev 138363)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp 2012-12-21 10:46:53 UTC (rev 138364)
@@ -75,10 +75,17 @@
GST_PLAY_FLAG_BUFFERING = 0x000000100
} GstPlayFlags;
+// gPercentMax is used when parsing buffering ranges with
+// gst_query_parse_nth_buffering_range as there was a bug in GStreamer
+// 0.10 that was using 100 instead of GST_FORMAT_PERCENT_MAX. This was
+// corrected in 1.0. gst_query_parse_buffering_range worked as
+// expected with GST_FORMAT_PERCENT_MAX in both cases.
#ifdef GST_API_VERSION_1
static const char* gPlaybinName = "playbin";
+static const gint64 gPercentMax = GST_FORMAT_PERCENT_MAX;
#else
static const char* gPlaybinName = "playbin2";
+static const gint64 gPercentMax = 100;
#endif
GST_DEBUG_CATEGORY_STATIC(webkit_media_player_debug);
@@ -758,11 +765,11 @@
return timeRanges.release();
}
- gint64 rangeStart = 0, rangeStop = 0;
for (guint index = 0; index < gst_query_get_n_buffering_ranges(query); index++) {
+ gint64 rangeStart = 0, rangeStop = 0;
if (gst_query_parse_nth_buffering_range(query, index, &rangeStart, &rangeStop))
- timeRanges->add(static_cast<float>((rangeStart * mediaDuration) / 100),
- static_cast<float>((rangeStop * mediaDuration) / 100));
+ timeRanges->add(static_cast<float>((rangeStart * mediaDuration) / gPercentMax),
+ static_cast<float>((rangeStop * mediaDuration) / gPercentMax));
}
// Fallback to the more general maxTimeLoaded() if no range has
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes