We had a checking to avoid the fake buffering. So nothing is broken I believe.<br><br><div class="gmail_quote">On Mon, Nov 24, 2008 at 9:23 PM, Seb Ruiz <span dir="ltr"><<a href="mailto:ruiz@kde.org">ruiz@kde.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Does anybody know if we have any workarounds in place that might be<br>
broken by this commit? Perhaps someone running phonon trunk could test<br>
that everything is still dandy.<br>
<br>
Cheers,<br>
Seb<br>
<br>
<br>
---------- Forwarded message ----------<br>
From: Matthias Kretz <<a href="mailto:kretz@kde.org">kretz@kde.org</a>><br>
Date: 2008/11/25<br>
Subject: kdesupport/phonon/xine<br>
To: <a href="mailto:kde-commits@kde.org">kde-commits@kde.org</a><br>
<br>
<br>
SVN commit 888428 by mkretz:<br>
<br>
remove fake state change to BufferingState on play as it's not<br>
consistent and other backends don't do it either<br>
<br>
M +1 -35 mediaobject.cpp<br>
M +0 -5 mediaobject.h<br>
<br>
<br>
--- trunk/kdesupport/phonon/xine/mediaobject.cpp #888427:888428<br>
@@ -57,9 +57,7 @@<br>
m_stream(static_cast<XineStream *>(SourceNode::threadSafeObject().data())),<br>
m_currentTitle(1),<br>
m_transitionTime(0),<br>
- m_autoplayTitles(true),<br>
- m_fakingBuffering(false),<br>
- m_shouldFakeBufferingOnPlay(true)<br>
+ m_autoplayTitles(true)<br>
{<br>
m_stream->setMediaObject(this);<br>
m_stream->useGaplessPlayback(true);<br>
@@ -192,10 +190,6 @@<br>
{<br>
debug() << Q_FUNC_INFO << green << "PLAY" << normal;<br>
m_stream->play();<br>
- if (m_shouldFakeBufferingOnPlay || m_state ==<br>
Phonon::StoppedState || m_state == Phonon::LoadingState || m_state ==<br>
Phonon::PausedState) {<br>
- m_shouldFakeBufferingOnPlay = false;<br>
- startToFakeBuffering();<br>
- }<br>
}<br>
<br>
void MediaObject::pause()<br>
@@ -226,40 +220,18 @@<br>
return m_stream->errorType();<br>
}<br>
<br>
-void MediaObject::startToFakeBuffering()<br>
-{<br>
- debug() << Q_FUNC_INFO << blue << "start faking" << normal;<br>
- m_fakingBuffering = true;<br>
- if (m_state == Phonon::BufferingState) {<br>
- return;<br>
- } else if (m_state == Phonon::PlayingState) {<br>
- // next time we reach StoppedState from LoadingState go right<br>
into BufferingState<br>
- return;<br>
- }<br>
-<br>
- debug() << Q_FUNC_INFO << "fake state change: reached<br>
BufferingState after " << m_state;<br>
-<br>
- Phonon::State oldstate = m_state;<br>
- m_state = Phonon::BufferingState;<br>
-<br>
- emit stateChanged(Phonon::BufferingState, oldstate);<br>
-}<br>
-<br>
void MediaObject::handleStateChange(Phonon::State newstate,<br>
Phonon::State oldstate)<br>
{<br>
if (m_state == newstate && m_state == BufferingState) {<br>
- m_fakingBuffering = false;<br>
debug() << Q_FUNC_INFO << blue << "end faking" << normal;<br>
// BufferingState -> BufferingState, nothing to do<br>
return;<br>
} else if (m_state != oldstate) {<br>
// m_state == oldstate always, except when faking buffering:<br>
- Q_ASSERT(m_fakingBuffering);<br>
<br>
// so we're faking BufferingState, then m_state must be in<br>
BufferingState<br>
Q_ASSERT(m_state == BufferingState);<br>
if (newstate == PlayingState || newstate == ErrorState) {<br>
- m_fakingBuffering = false;<br>
debug() << Q_FUNC_INFO << blue << "end faking" << normal;<br>
oldstate = m_state;<br>
} else {<br>
@@ -267,8 +239,6 @@<br>
// PlayingState or ErrorState<br>
return;<br>
}<br>
- } else if (oldstate == LoadingState && newstate == StoppedState<br>
&& m_fakingBuffering) {<br>
- newstate = BufferingState;<br>
}<br>
m_state = newstate;<br>
<br>
@@ -355,7 +325,6 @@<br>
if (source.url().scheme() == QLatin1String("kbytestream")) {<br>
m_mediaSource = MediaSource();<br>
qWarning() << "do not ever use kbytestream:/ URLs with<br>
MediaObject!";<br>
- m_shouldFakeBufferingOnPlay = false;<br>
m_stream->setMrl(QByteArray());<br>
m_stream->setError(Phonon::NormalError, tr("Cannot open<br>
media data at '<i>%1</i>'").arg(source.url().toString(QUrl::RemovePassword)));<br>
return;<br>
@@ -365,7 +334,6 @@<br>
m_stream->gaplessSwitchTo(source.url());<br>
break;<br>
case HardSwitch:<br>
- m_shouldFakeBufferingOnPlay = true;<br>
m_stream->setUrl(source.url());<br>
break;<br>
}<br>
@@ -402,7 +370,6 @@<br>
m_stream->gaplessSwitchTo(mrl);<br>
break;<br>
case HardSwitch:<br>
- m_shouldFakeBufferingOnPlay = true;<br>
m_stream->setMrl(mrl);<br>
break;<br>
}<br>
@@ -418,7 +385,6 @@<br>
m_stream->gaplessSwitchTo(m_bytestream->mrl());<br>
break;<br>
case HardSwitch:<br>
- m_shouldFakeBufferingOnPlay = true;<br>
m_stream->setMrl(m_bytestream->mrl());<br>
break;<br>
}<br>
--- trunk/kdesupport/phonon/xine/mediaobject.h #888427:888428<br>
@@ -117,9 +117,6 @@<br>
void availableAnglesChanged(int);<br>
void angleChanged(int);<br>
<br>
- protected slots:<br>
- void startToFakeBuffering();<br>
-<br>
private slots:<br>
void handleStateChange(Phonon::State newstate, Phonon::State oldstate);<br>
void needNextUrl();<br>
@@ -149,8 +146,6 @@<br>
qint32 m_prefinishMark;<br>
qint32 m_transitionTime;<br>
bool m_autoplayTitles : 1;<br>
- bool m_fakingBuffering : 1;<br>
- bool m_shouldFakeBufferingOnPlay : 1;<br>
};<br>
}} //namespace Phonon::Xine<br>
<br>
<br>
<br>
<br>
--<br>
Seb Ruiz<br>
<br>
<a href="http://www.sebruiz.net/" target="_blank">http://www.sebruiz.net/</a><br>
<a href="http://amarok.kde.org/" target="_blank">http://amarok.kde.org/</a><br>
_______________________________________________<br>
Amarok-devel mailing list<br>
<a href="mailto:Amarok-devel@kde.org">Amarok-devel@kde.org</a><br>
<a href="https://mail.kde.org/mailman/listinfo/amarok-devel" target="_blank">https://mail.kde.org/mailman/listinfo/amarok-devel</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>Cheers,<br>Peter ZHOU<br>-------------------------------<br><a href="http://www.peterzl.net/">http://www.peterzl.net/</a><br>