What if it has been disconnected before? I think it would be better to save the handler id and use g_signal_handler_disconnect() and invalidate the id.
> Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:1350
> + if (g_strcmp0(G_OBJECT_CLASS_NAME(G_OBJECT_GET_CLASS(G_OBJECT(element))), "GstDownloadBuffer"))
GST_IS_DOWNLOAD_BUFFER?
> Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:1395
> + // Transform "-XXXXXX" into "-??????" to get a file wildcard expression from the template.
> + for (char* p = &templateFile.get()[strlen(templateFile.get()) - 1]; p >= templateFile.get() && *p == 'X'; --p)
> + *p = '?';
I'm not sure I understand this, maybe you can simply do g_strdelimit (templateFile.get(), "X", '?');
Can't you pass something like "*-XXXXXX*" as pattern to listDirectory?
Comment on attachment 300398
Patch
View in context: https:/ /bugs.webkit. org/attachment. cgi?id= 300398& action= review
> Source/ WebCore/ platform/ graphics/ gstreamer/ MediaPlayerPriv ateGStreamer. cpp:40 FileSystem. h>
> +#include <WebCore/
Don't use <> since you are in WebCore.
> Source/ WebCore/ platform/ graphics/ gstreamer/ MediaPlayerPriv ateGStreamer. cpp:203 IS_WEB_ SRC(m_source. get()))
> + if (m_source && WEBKIT_
G_TYPE_ CHECK_INSTANCE_ TYPE already null checks the pointer.
> Source/ WebCore/ platform/ graphics/ gstreamer/ MediaPlayerPriv ateGStreamer. cpp:204 handlers_ disconnect_ by_func( GST_ELEMENT_ PARENT( m_source. get()), reinterpret_ cast<gpointer> (uriDecodeBinEl ementAddedCallb ack), this);
> + g_signal_
What if it has been disconnected before? I think it would be better to save the handler id and use g_signal_ handler_ disconnect( ) and invalidate the id.
> Source/ WebCore/ platform/ graphics/ gstreamer/ MediaPlayerPriv ateGStreamer. cpp:1350 G_OBJECT_ CLASS_NAME( G_OBJECT_ GET_CLASS( G_OBJECT( element) )), "GstDownloadBuf fer"))
> + if (g_strcmp0(
GST_IS_ DOWNLOAD_ BUFFER?
> Source/ WebCore/ platform/ graphics/ gstreamer/ MediaPlayerPriv ateGStreamer. cpp:1395 get()[strlen( templateFile. get()) - 1]; p >= templateFile.get() && *p == 'X'; --p)
> + // Transform "-XXXXXX" into "-??????" to get a file wildcard expression from the template.
> + for (char* p = &templateFile.
> + *p = '?';
I'm not sure I understand this, maybe you can simply do g_strdelimit (templateFile. get(), "X", '?');
Can't you pass something like "*-XXXXXX*" as pattern to listDirectory?
> Source/ WebCore/ platform/ graphics/ gstreamer/ MediaPlayerPriv ateGStreamer. cpp:1397 templatePath. get(), templateFile. get())) {
> + for (auto filePath : listDirectory(
auto&
> Source/ WebCore/ platform/ graphics/ gstreamer/ MediaPlayerPriv ateGStreamer. cpp:1409 IS_WEB_ SRC(m_source. get()))
> + if (m_source && WEBKIT_
G_TYPE_ CHECK_INSTANCE_ TYPE already null checks the pointer.