[Webkit-unassigned] [Bug 140116] [GStreamer][MSE] ASSERT in MediaSourceGStreamer::addSourceBuffer

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jan 8 02:41:43 PST 2015


https://bugs.webkit.org/show_bug.cgi?id=140116

--- Comment #10 from Carlos Garcia Campos <cgarcia at igalia.com> ---
Comment on attachment 244058
  --> https://bugs.webkit.org/attachment.cgi?id=244058
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=244058&action=review

> Source/WebCore/platform/graphics/gstreamer/MediaSourceGStreamer.cpp:65
> +    for (auto it = m_sourceBuffers.begin(), end = m_sourceBuffers.end(); it != end; ++it)
> +        (*it)->clearMediaSource();

This could be 

for (auto& sourceBuffer : m_sourceBuffers)
    sourceBuffer.clearMediaSource();

> Source/WebCore/platform/graphics/gstreamer/MediaSourceGStreamer.cpp:79
> +    return m_client->addSourceBuffer(m_sourceBuffers.last(), contentType);

You could use sourceBufferPrivate.get() here instead of calling last() again.

> Source/WebCore/platform/graphics/gstreamer/MediaSourceGStreamer.cpp:87
> +    size_t index = m_sourceBuffers.find(buffer);
> +    m_sourceBuffers.remove(index);

Shouldn't you also call clearMediaSource() here? Since it's removed from the vector here, it won't be called for this source bufer in the destructor. Since the order doesn't really matter, and we are always adding a new SourceBufferPrivateGStreamer, I wonder whether we could use a HashSet instead, and here you would just take the buffer can call clearMediaSource (if it's actually needed)

> Source/WebCore/platform/graphics/gstreamer/MediaSourceGStreamer.h:50
> +    MediaSourceClientGStreamer* client() const { return m_client.get(); }

Since m_client can't be null, you could return a reference instead.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20150108/6958c425/attachment-0002.html>


More information about the webkit-unassigned mailing list