[Webkit-unassigned] [Bug 35328] [Qt] Various Fixes to MediaPlayerPrivateQt
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Thu Feb 25 08:41:03 PST 2010
https://bugs.webkit.org/show_bug.cgi?id=35328
--- Comment #9 from Tor Arne Vestbø <vestbo at webkit.org> 2010-02-25 08:41:03 PST ---
(From update of attachment 49466)
> - unsigned percentage = m_mediaPlayer->bufferStatus();
> -
> - if (percentage == 100) {
> - if (m_networkState != MediaPlayer::Idle) {
> - m_networkState = MediaPlayer::Idle;
> - m_player->networkStateChanged();
> - }
> - if (m_readyState != MediaPlayer::HaveEnoughData) {
> - m_readyState = MediaPlayer::HaveEnoughData;
> - m_player->readyStateChanged();
> - }
> - }
> -
> QLatin1String bytesLoadedKey("bytes-loaded");
> if (m_mediaPlayer->availableExtendedMetaData().contains(bytesLoadedKey))
> return m_mediaPlayer->extendedMetaData(bytesLoadedKey).toInt();
>
> - return percentage;
> + return (m_mediaPlayer->bufferStatus() * totalBytes()) / 100;
> }
>
> unsigned MediaPlayerPrivate::totalBytes() const
> @@ -468,16 +451,19 @@ void MediaPlayerPrivate::updateStates()
> m_networkState = MediaPlayer::FormatError;
> else
> m_networkState = MediaPlayer::NetworkError;
> - } else if (currentStatus == QMediaPlayer::UnknownMediaStatus
> - || currentStatus == QMediaPlayer::NoMedia) {
> + } else if (currentStatus == QMediaPlayer::NoMedia) {
> m_networkState = MediaPlayer::Idle;
> m_readyState = MediaPlayer::HaveNothing;
> + } else if (currentStatus == QMediaPlayer::UnknownMediaStatus) {
> + // If the status is unknown, it's quite likely we are able to play
> + m_networkState = MediaPlayer::Idle;
> + m_readyState = MediaPlayer::HaveEnoughData;
Doing this makes loading the Transformers trailer go from instantaneous to 5-10
seconds before the first loadedmetadata, and even then it does not seem to load
fully to be able to play.
Presumably because we have the buffer filled to 100%, which with the old code
would dump us into Idle and HaveEnoughData, but now we don't update our states
anymore on bytesLoaded() (a good thing per se).
I tried doing updateStates() on the bufferStateChange() signal, which I would
assume would be the right fix, but that didn't change anything as we don't seem
to receive this signal :/
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list