[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.18-1-697-g2f78b87
philn at webkit.org
philn at webkit.org
Wed Jan 20 22:23:49 UTC 2010
The following commit has been merged in the debian/unstable branch:
commit 6ba4af1fab5c0ab44921e20c2cbbb5228b06488e
Author: philn at webkit.org <philn at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Jan 14 08:33:27 2010 +0000
Reviewed by Xan Lopez.
[GTK] un-needed seeks
https://bugs.webkit.org/show_bug.cgi?id=33532
Avoid un-needed seeks. Don't seek at current playback position and
don't update the rate if it is already set to target value.
* platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivate::MediaPlayerPrivate):
(WebCore::MediaPlayerPrivate::seek):
(WebCore::MediaPlayerPrivate::setRate):
* platform/graphics/gtk/MediaPlayerPrivateGStreamer.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@53244 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 0bbff28..cd4612e 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,19 @@
+2010-01-12 Philippe Normand <pnormand at igalia.com>
+
+ Reviewed by Xan Lopez.
+
+ [GTK] un-needed seeks
+ https://bugs.webkit.org/show_bug.cgi?id=33532
+
+ Avoid un-needed seeks. Don't seek at current playback position and
+ don't update the rate if it is already set to target value.
+
+ * platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp:
+ (WebCore::MediaPlayerPrivate::MediaPlayerPrivate):
+ (WebCore::MediaPlayerPrivate::seek):
+ (WebCore::MediaPlayerPrivate::setRate):
+ * platform/graphics/gtk/MediaPlayerPrivateGStreamer.h:
+
2010-01-14 Eric Seidel <eric at webkit.org>
No review. Tiger build fix after http://trac.webkit.org/changeset/53238.
diff --git a/WebCore/platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp b/WebCore/platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp
index 0984a46..4bcfb69 100644
--- a/WebCore/platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp
+++ b/WebCore/platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp
@@ -209,6 +209,7 @@ MediaPlayerPrivate::MediaPlayerPrivate(MediaPlayer* player)
, m_buffer(0)
, m_paused(true)
, m_seeking(false)
+ , m_playbackRate(1)
, m_errorOccured(false)
, m_volumeIdleId(-1)
{
@@ -321,7 +322,9 @@ float MediaPlayerPrivate::currentTime() const
void MediaPlayerPrivate::seek(float time)
{
- GstClockTime sec = (GstClockTime)(time * GST_SECOND);
+ // Avoid useless seeking.
+ if (time == playbackPosition(m_playBin))
+ return;
if (!m_playBin)
return;
@@ -332,6 +335,7 @@ void MediaPlayerPrivate::seek(float time)
if (m_errorOccured)
return;
+ GstClockTime sec = (GstClockTime)(time * GST_SECOND);
LOG_VERBOSE(Media, "Seek: %" GST_TIME_FORMAT, GST_TIME_ARGS(sec));
if (!gst_element_seek(m_playBin, m_player->rate(),
GST_FORMAT_TIME,
@@ -444,6 +448,10 @@ void MediaPlayerPrivate::volumeChanged()
void MediaPlayerPrivate::setRate(float rate)
{
+ // Avoid useless playback rate update.
+ if (m_playbackRate == rate)
+ return;
+
GstState state;
GstState pending;
@@ -455,6 +463,7 @@ void MediaPlayerPrivate::setRate(float rate)
if (m_isStreaming)
return;
+ m_playbackRate = rate;
m_changingRate = true;
float currentPosition = playbackPosition(m_playBin) * GST_SECOND;
GstSeekFlags flags = (GstSeekFlags)(GST_SEEK_FLAG_FLUSH);
diff --git a/WebCore/platform/graphics/gtk/MediaPlayerPrivateGStreamer.h b/WebCore/platform/graphics/gtk/MediaPlayerPrivateGStreamer.h
index 4717999..917c253 100644
--- a/WebCore/platform/graphics/gtk/MediaPlayerPrivateGStreamer.h
+++ b/WebCore/platform/graphics/gtk/MediaPlayerPrivateGStreamer.h
@@ -140,6 +140,7 @@ class MediaPlayerPrivate : public MediaPlayerPrivateInterface {
bool m_paused;
bool m_seeking;
+ float m_playbackRate;
bool m_errorOccured;
guint m_volumeIdleId;
};
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list