Changeset 202558 in webkit
- Timestamp:
- Jun 28, 2016 4:26:07 AM (8 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r202556 r202558 1 2016-06-28 Philippe Normand <pnormand@igalia.com> 2 3 [GStreamer] usec rounding is wrong during accurate seeking 4 https://bugs.webkit.org/show_bug.cgi?id=90734 5 6 Reviewed by Carlos Garcia Campos. 7 8 Use floor() to round the microseconds value, this is more robust 9 than roundf. 10 11 * platform/graphics/gstreamer/GStreamerUtilities.cpp: 12 (WebCore::toGstClockTime): 13 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: 14 (WebCore::MediaPlayerPrivateGStreamer::playbackPosition): 15 1 16 2016-06-28 Philippe Normand <pnormand@igalia.com> 2 17 -
trunk/Source/WebCore/platform/graphics/gstreamer/GStreamerUtilities.cpp
r201163 r202558 183 183 GTimeVal timeValue; 184 184 timeValue.tv_sec = static_cast<glong>(seconds); 185 timeValue.tv_usec = static_cast<glong>( roundf(microSeconds / 10000) * 10000);185 timeValue.tv_usec = static_cast<glong>(floor(microSeconds + 0.5)); 186 186 return GST_TIMEVAL_TO_TIME(timeValue); 187 187 } -
trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
r202272 r202558 310 310 if (gst_element_query(m_pipeline.get(), query)) 311 311 gst_query_parse_position(query, 0, &position); 312 gst_query_unref(query); 313 314 LOG_MEDIA_MESSAGE("Position %" GST_TIME_FORMAT, GST_TIME_ARGS(position)); 312 315 313 316 float result = 0.0f; 314 if (static_cast<GstClockTime>(position) != GST_CLOCK_TIME_NONE) 315 result = static_cast<double>(position) / GST_SECOND; 316 else if (m_canFallBackToLastFinishedSeekPosition) 317 if (static_cast<GstClockTime>(position) != GST_CLOCK_TIME_NONE) { 318 GTimeVal timeValue; 319 GST_TIME_TO_TIMEVAL(position, timeValue); 320 result = static_cast<float>(timeValue.tv_sec + (timeValue.tv_usec / 1000000.0)); 321 } else if (m_canFallBackToLastFinishedSeekPosition) 317 322 result = m_seekTime; 318 319 LOG_MEDIA_MESSAGE("Position %" GST_TIME_FORMAT, GST_TIME_ARGS(position));320 321 gst_query_unref(query);322 323 323 324 return result;
Note: See TracChangeset
for help on using the changeset viewer.