[MSE] Dead code in SourceBuffer::appendBufferTimerFired()
authoreocanha@igalia.com <eocanha@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 6 Oct 2017 07:43:53 +0000 (07:43 +0000)
committereocanha@igalia.com <eocanha@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 6 Oct 2017 07:43:53 +0000 (07:43 +0000)
https://bugs.webkit.org/show_bug.cgi?id=177951

Reviewed by Jer Noble.

Covered by LayoutTests/imported/w3c/web-platform-tests/media-source/mediasource-append-buffer.html.

* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::appendBufferTimerFired): Remove redundant code.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222965 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/Modules/mediasource/SourceBuffer.cpp

index df95cd3..1824fea 100644 (file)
@@ -1,3 +1,15 @@
+2017-10-06  Enrique Ocaña González  <eocanha@igalia.com>
+
+        [MSE] Dead code in SourceBuffer::appendBufferTimerFired()
+        https://bugs.webkit.org/show_bug.cgi?id=177951
+
+        Reviewed by Jer Noble.
+
+        Covered by LayoutTests/imported/w3c/web-platform-tests/media-source/mediasource-append-buffer.html.
+
+        * Modules/mediasource/SourceBuffer.cpp:
+        (WebCore::SourceBuffer::appendBufferTimerFired): Remove redundant code.
+
 2017-10-06  Ryosuke Niwa  <rniwa@webkit.org>
 
         Split StaticPasteboard::writeString into writeString and writeStringInCustomData
index 424e241..ea52826 100644 (file)
@@ -547,13 +547,6 @@ void SourceBuffer::appendBufferTimerFired()
     // https://dvcs.w3.org/hg/html-media/raw-file/default/media-source/media-source.html#sourcebuffer-buffer-append
 
     // 1. Run the segment parser loop algorithm.
-    size_t appendSize = m_pendingAppendData.size();
-    if (!appendSize) {
-        // Resize buffer for 0 byte appends so we always have a valid pointer.
-        // We need to convey all appends, even 0 byte ones to |m_private| so
-        // that it can clear its end of stream state if necessary.
-        m_pendingAppendData.resize(1);
-    }
 
     // Section 3.5.1 Segment Parser Loop
     // https://dvcs.w3.org/hg/html-media/raw-file/tip/media-source/media-source.html#sourcebuffer-segment-parser-loop
@@ -565,7 +558,7 @@ void SourceBuffer::appendBufferTimerFired()
         return;
     }
 
-    m_private->append(m_pendingAppendData.data(), appendSize);
+    m_private->append(m_pendingAppendData.data(), m_pendingAppendData.size());
     m_pendingAppendData.clear();
 }