Index: Source/WebCore/html/HTMLMediaElement.cpp |
=================================================================== |
--- Source/WebCore/html/HTMLMediaElement.cpp (revision 133510) |
+++ Source/WebCore/html/HTMLMediaElement.cpp (working copy) |
@@ -363,8 +363,10 @@ |
{ |
if (attribute.name() == srcAttr) { |
// Trigger a reload, as long as the 'src' attribute is present. |
- if (fastHasAttribute(srcAttr)) |
+ if (fastHasAttribute(srcAttr)) { |
+ clearMediaPlayer(MediaResource); |
scheduleLoad(MediaResource); |
+ } |
} else if (attribute.name() == controlsAttr) |
configureMediaControls(); |
#if PLATFORM(MAC) |
@@ -3670,13 +3672,7 @@ |
// If the media data fetching process is aborted by the user: |
// 1 - The user agent should cancel the fetching process. |
-#if !ENABLE(PLUGIN_PROXY_FOR_VIDEO) |
- m_player.clear(); |
-#endif |
- stopPeriodicTimers(); |
- m_loadTimer.stop(); |
- m_loadState = WaitingForSource; |
- m_pendingLoadFlags = 0; |
+ clearMediaPlayer(-1); |
// 2 - Set the error attribute to a new MediaError object whose code attribute is set to MEDIA_ERR_ABORTED. |
m_error = MediaError::create(MediaError::MEDIA_ERR_ABORTED); |
@@ -3714,6 +3710,18 @@ |
#endif |
} |
+void HTMLMediaElement::clearMediaPlayer(unsigned flags) |
+{ |
+#if !ENABLE(PLUGIN_PROXY_FOR_VIDEO) |
+ m_player.clear(); |
+#endif |
+ stopPeriodicTimers(); |
+ m_loadTimer.stop(); |
+ |
+ m_pendingLoadFlags &= ~flags; |
+ m_loadState = WaitingForSource; |
+} |
+ |
bool HTMLMediaElement::canSuspend() const |
{ |
return true; |
@@ -4261,7 +4269,7 @@ |
if (m_audioSourceNode) |
m_audioSourceNode->lock(); |
#endif |
- |
+ |
m_player = MediaPlayer::create(this); |
#if ENABLE(MEDIA_SOURCE) |