summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorscherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-25 18:08:16 +0000
committerscherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-25 18:08:16 +0000
commit867e5927e973c3380772ff4c07d43cc58459751c (patch)
treeb74adc86f729dfacf952d61c5112b5954ae11552
parent151a96f357cdd774c0a890204563e57f83568db1 (diff)
downloadchromium_src-867e5927e973c3380772ff4c07d43cc58459751c.zip
chromium_src-867e5927e973c3380772ff4c07d43cc58459751c.tar.gz
chromium_src-867e5927e973c3380772ff4c07d43cc58459751c.tar.bz2
Fixes bug where changing the src of an audio/video element would stop firing events.
HTMLMediaElement keeps track of network/ready state separately. When re-using an element by setting the src and calling load(), HTMLMediaElement's network/ready states became out of sync with the actual values inside WebMediaPlayerImpl. This led to the second media never firing 'loadedmetadata' and other events. BUG=16768,20152 TEST=change src of an audio/video, call load(), should see durationchange and loadedmetadata events Review URL: http://codereview.chromium.org/174385 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24251 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--webkit/glue/webmediaplayer_impl.cc14
1 files changed, 6 insertions, 8 deletions
diff --git a/webkit/glue/webmediaplayer_impl.cc b/webkit/glue/webmediaplayer_impl.cc
index 0438e54..9396037 100644
--- a/webkit/glue/webmediaplayer_impl.cc
+++ b/webkit/glue/webmediaplayer_impl.cc
@@ -542,19 +542,17 @@ void WebMediaPlayerImpl::OnPipelineError() {
void WebMediaPlayerImpl::SetNetworkState(
WebKit::WebMediaPlayer::NetworkState state) {
DCHECK(MessageLoop::current() == main_loop_);
- if (network_state_ != state) {
- network_state_ = state;
- GetClient()->networkStateChanged();
- }
+ // Always notify to ensure client has the latest value.
+ network_state_ = state;
+ GetClient()->networkStateChanged();
}
void WebMediaPlayerImpl::SetReadyState(
WebKit::WebMediaPlayer::ReadyState state) {
DCHECK(MessageLoop::current() == main_loop_);
- if (ready_state_ != state) {
- ready_state_ = state;
- GetClient()->readyStateChanged();
- }
+ // Always notify to ensure client has the latest value.
+ ready_state_ = state;
+ GetClient()->readyStateChanged();
}
void WebMediaPlayerImpl::Destroy() {